[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-libc-dev] RE: [bug #17216] change to the ../util/delay.h header
From: |
Joerg Wunsch |
Subject: |
Re: [avr-libc-dev] RE: [bug #17216] change to the ../util/delay.h header for increased functionality |
Date: |
Wed, 19 Aug 2009 06:14:40 +0200 |
User-agent: |
Mutt/1.5.11 |
As Weddington, Eric wrote:
> > But now that it works, can we update the <util/delay.h> to use it?
>
> Patches welcome.
The big thing I'm seeing with __delay_cycles is: How to *detect* it
from <util/delay.h>?
Either, the patch (and future public implementation) can "announce"
itself by the existence of a preprocessor macro, so applications could
e.g. write
#if defined(__HAVE_DELAY_CYCLES)
__delay_cycles(n);
#else
__delay_loop_1(n / 3);
#endif
(this would IMHO be the best solution), or we have to rewrite
avr-libc's source code to derive the actual <util/delay.h> from a file
named delay.h.in, where the final file is generated at build time,
based on some autoconf probed compiler feature. Obviously, this is
more effort to implement, and it will only work provided the compiler
avr-libc has been configured for is the same avr-libc is then going to
be used with.
--
cheers, J"org .-.-. --... ...-- -.. . DL8DTL
http://www.sax.de/~joerg/ NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)