|
Re: Interupts/sec
Quote:
|
Originally Posted by Kevin Sevcik
Also remember that the tighter your interrupt handler and other code is, the more interrupts you'll be able to handle. If you're only using Encoder 1 and 2, you can excise all the code for Encoders 3-6 and save yourself 5 branches and a bit of extra code in the interrupt handler. Ditto the serial ports. Basically, dump anything in your code that's not serving any purpose.
|
And by dump he means comment out in case you end up needng it later. For stuff thats going to be perma-commented I like to use #ifdefs
Code:
#ifdef IWANTINT3TO6
...interrupt 3-6 and such code...
#endif
So now later if you want to enable them, at the top of your file, just put
Code:
#define IWANTINT3TO6
I find it useful to convert the default code in to a series of modules that can be 'enabled' by #define's.
__________________
Matt Krass
If I suggest something to try and fix a problem, and you don't understand what I mean, please PM me!
I'm a FIRST relic of sorts, I remember when we used PBASIC and we got CH Flightsticks in the KoP. In my day we didn't have motorized carts, we pushed our robots uphill, both ways! (Houston 2003!)
|