> -----Original Message-----
> From: 
> avr-gcc-list-bounces+eric.weddington=atmel....@nongnu.org 
> [mailto:avr-gcc-list-bounces+eric.weddington=atmel....@nongnu.
> org] On Behalf Of Michael Clift
> Sent: Monday, September 13, 2010 9:35 PM
> To: Avr-Gcc-List
> Subject: Re: [avr-gcc-list] avr-c++ can I use templates to 
> avoid creatingunnecessary ISRs?
> 
> 
> 
> Hi Robert, just a thought...
> 
> If the user wanted to programatically assign ISR's to either your 
> library handleInterrupt<id>() functions, or their own functions, then 
> maybe the main application should contain ISR()'s which call function 
> pointers?
> The function pointers could then be loaded with either the address of 
> your library functions, or the users own functions.
> 

That could work... Those are typically called "callback" functions. Note that 
there is a tradeoff with doing that: Because a function will be called in an 
ISR, the ISR prologue and epilogue will be bloated out because of having to 
save/restore a lot of registers. Just a warning.

_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Reply via email to