> -----Original Message----- > From: avr-libc-dev-bounces+eric.weddington=atmel....@nongnu.org > [mailto:avr-libc-dev-bounces+eric.weddington=atmel....@nongnu.org] On > Behalf Of Joerg Wunsch > Sent: Thursday, November 01, 2012 10:26 AM > To: avr-libc-dev@nongnu.org > Subject: Re: [avr-libc-dev] Possible hole in the assembler interrupt > documentation > > However, I think putting ISRs in libraries is a rarely used feature, > so I'm not sure the avr-libc documentation would really be a good > place for it. Well, if someone crafted a FAQ entry, this might be an > idea.
I already wrote docs in the avr-libc user manual about how to write libraries, and in that I include the case of including an ISR in a library. An no, it's not necessarily that rare of event. For example, one might want to have a UART library that includes ISRs for receive and transmit functions. In the docs, I explain that the best way to do that is to include the ISR function in the same module with your subsystem initialization function. The idea is that the init function will *always* have to be called to initialize the subsystem. Therefore the application will always reference that module and the ISR will always be pulled in (because it's in the same compilation module as the init routine). It's all in how you design the library, but you have to know and understand what's going on behind the scenes of your toolchain to get the design right sometimes. HTH, Eric Weddington _______________________________________________ AVR-libc-dev mailing list AVR-libc-dev@nongnu.org https://lists.nongnu.org/mailman/listinfo/avr-libc-dev