On Feb 20, 2013, at 2:08 , David Brown <[email protected]> wrote:

> Another option that might be usable (depending on how things are split
> within different modules) is to make the ISR just a wrapper for the
> "real" code:
> 
> class x {
>       friend void ::timerInterrupt(void);
> private :
>       int i;
> };
> 
> class x the_x;
> 
> static void timerInterrupt(void) {
>       the_x.i++;
> }
> 
> ISR(TIMER1_OVF_vect) {
>       timerInterrupt();
> }
> 
> 
> With non-negligible optimisations enabled, the static timerInterrupt
> function will be inlined within the ISR function, so there is no extra
> overhead.  (Normally there can be significant overhead if an interrupt
> function calls an external function.)
> 
> Just a thought for another style.

Yeah, that's how I had been doing it, but I wanted to ensure I didn't have the 
overhead in this case, even when no optimizations were used.

-- 
Rick




_______________________________________________
AVR-chat mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/avr-chat

Reply via email to