[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avr-libc-dev] RE: [bug #17216] change to the ../util/delay.h header for
[avr-libc-dev] RE: [bug #17216] change to the ../util/delay.h header for increased functionality
Mon, 17 Aug 2009 19:30:02 -0600
> -----Original Message-----
> From: Bill Perry [mailto:address@hidden
> Sent: Monday, August 17, 2009 3:41 PM
> To: Joerg Wunsch; Bill Perry; Weddington, Eric;
> Subject: [bug #17216] change to the ../util/delay.h header
> for increased functionality
> Follow-up Comment #3, bug #17216 (project avr-libc):
> Is is possible to move this forward?
> The existing delay macros/functions do have problems.
There is a patch to the GCC toolchain, which has been included in the last two
releases of WinAVR, that provides new builtin functions, including a function
that will delay a specified number of cycles:
extern void __builtin_avr_delay_cycles(unsigned long __n);
The parameter to this function is an unsigned long which is an unsigned 32-bit
number of cycles to delay. When you use this function in your application, GCC
will replace the function with "do-nothing" assembly code that will delay the
specified number of cycles.
This function has not been widely advertised, but it should work for you.
Perhaps this will help you in your search for a better delay.