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

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

Re: [avr-libc-dev] empty interrupts


From: E. Weddington
Subject: Re: [avr-libc-dev] empty interrupts
Date: Wed, 07 May 2003 17:17:19 -0600

On 11 Apr 2003 at 8:20, Artur Lipowski wrote:

> Hi,
> 
> Sometimes we need to enable interrupt but nothing should be done in
> the ISR (eg. using ADC noise canceler function). Declaring a standard
> SIGNAL macro and leaving empty body works fine but... There is still
> generated prolog and epilog for ISR and a few words of FLASH is lost
> as weel as a few CPU cycles. I know this is nothing importand but
> sometimes it can be significant. Because of above I use in my projects
> following defines:
> 
> #ifdef __cplusplus
> #define EMPTY_INTERRUPT(signame)            \
> extern "C" void signame(void);                          \
> void signame (void) __attribute__((naked)) ;      \
> void signame (void) {  __asm__ __volatile__ ("reti" ::); }
> #else
> #define EMPTY_INTERRUPT(signame)                \
> void signame (void) __attribute__((naked)) ;           \
> void signame (void) { __asm__ __volatile__ ("reti" ::); }
> #endif
> 
> and obvious usage:
> EMPTY_INTERRUPT(SIG_ADC);
> 
> 
> What about adding this to the avr-libc?
> 


Any objections to adding this to avr/signal.h?

Eric




reply via email to

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