On Wed, 16 Aug 2006 13:37:11 -0400, Björn Haase <[EMAIL PROTECTED]> wrote:

The problem is that the list files shows that floating point library
is being used, when comments in delay.h say that should not happen.

I realized my mistake about five seconds after hitting "Send".
I was passing a variable to __delay_us(), not compile time constant.

Also the function was not inlined when I called it.

I have -Os for optimization.  This is with WinAVR345.

Maybe try adding

"inline __attribute__ ((always_inline))"

Thank you.

I found:
#define delay_15us()\
 do{ uint8_t irq_state_u8 = SREG;\
 __disable_interrupt();\
 _delay_us( (double) 15 );\
 SREG = irq_state_u8; }while(0)

did what I needed.

Is there any reason to prefer a macro over
a inlined function or vice-versa?



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

Reply via email to