[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Options on avr-gcc
From: |
Joerg Wunsch |
Subject: |
Re: [avr-gcc-list] Options on avr-gcc |
Date: |
Mon, 12 Feb 2007 20:24:00 +0100 (MET) |
Javier Almansa Sobrino <address@hidden> wrote:
> Any one knows what option I must to pass to AVR-GCC when compile to
> avoid this.
The best option is to don't try rolling your own loops at all.
Instead, use the functions from <util/delay.h>. There are two
functions (with a different argument range) that can delay for 3 (up
to 256 times) or 4 (up to 65536 times) per loop, and there are two
convenience functions that can delay for a (floating-point) number of
microseconds or milliseconds, respectively, based on the CPU frequency
passed in as F_CPU. The latter will only work correctly though if
optimization is enabled.
--
cheers, J"org .-.-. --... ...-- -.. . DL8DTL
http://www.sax.de/~joerg/ NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)