> -----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 Georg-
> Johann Lay
> Sent: Monday, April 30, 2012 9:03 AM
> To: avr-gcc-list@nongnu.org
> Cc: Jörg Wunsch
> Subject: [avr-gcc-list] avr-libc: interrupt.h, ISR and ISR_NOBLOCK
> 
> AVR-LIbC's ISR-macros lead to confusing results for code like, e.g.
> 
> #include <avr/io.h>
> #include <avr/interrupt.h>
> 
> void *p;
> 
> ISR (ADC_vect, ISR_NOBLOCK)
> {
>      char c[10];
>      p = c;
> }
> 
> which resolves a.a. to
> 
> void __vector_21 (void)
> __attribute__ ((signal,used,externally_visible)) __attribute__((interrupt));
> 
> 
> Which states that IRQs are turned off (signal) and IRQs are turned on
> (interrupt) at the same time.

I haven't looked at the avr-libc code in a long time; I didn't know it actually 
generated that. :-/

I agree that it shouldn't do that, and it should generate clean code.


> This leads to unexpected code generated by the compiler.
> 
> Thus, I'd like to introduce an error in avr-gcc saying
> 
> "function can only be one of 'interrupt', 'signal', 'OS_task', 'OS_main'
> at the same time"

What should OS_task and OS_main be? OS_main as uninterruptable? OS_task as 
interruptable?

I have no problem with throwing an error in avr-gcc, as long as we get avr-libc 
fixed at the same time.

Eric

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

Reply via email to