avr-libc-dev
[Top][All Lists]
Advanced

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

Re: [avr-libc-dev] Possible hole in the assembler interrupt documentatio


From: Weddington, Eric
Subject: Re: [avr-libc-dev] Possible hole in the assembler interrupt documentation
Date: Thu, 1 Nov 2012 18:10:04 +0000

> -----Original Message-----
> From: address@hidden
> [mailto:address@hidden On
> Behalf Of Joerg Wunsch
> Sent: Thursday, November 01, 2012 10:26 AM
> To: address@hidden
> 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



reply via email to

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