avr-gcc-list
[Top][All Lists]
Advanced

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

Re: [avr-gcc-list] Using delay functions with variable F_CPU clock?


From: Joerg Wunsch
Subject: Re: [avr-gcc-list] Using delay functions with variable F_CPU clock?
Date: Wed, 4 Mar 2009 22:30:56 +0100 (MET)

Bob Paddock <address@hidden> wrote:

> Is there a way of doing:
> 
>  _delay_us( double __us, uint32_t f_cpu )
> 
> and still have the compiler generate code that does not
> invoke floating point at run time?

#undef F_CPU
#define F_CPU new_value
....
  _delay_us(us);

F_CPU is always evaluated upon each invocation, so if you ever change
it within one compilation unit, the next invocation of one of these
macros will reflect this.

-- 
cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/                        NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)




reply via email to

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