[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] _delay_us pulling in floating point lib
From: |
Bob Paddock |
Subject: |
Re: [avr-gcc-list] _delay_us pulling in floating point lib |
Date: |
Wed, 16 Aug 2006 13:21:01 -0400 |
User-agent: |
Opera M2/8.54 (Win32, build 7730) |
On Wed, 16 Aug 2006 13:37:11 -0400, Björn Haase <address@hidden>
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?