avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [avr-gcc-list] avr-c++ can I use templates to avoid creatingunnecess


From: Weddington, Eric
Subject: RE: [avr-gcc-list] avr-c++ can I use templates to avoid creatingunnecessary ISRs?
Date: Tue, 14 Sep 2010 08:02:07 -0600

 

> -----Original Message-----
> From: 
> address@hidden 
> [mailto:address@hidden
> 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]