[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Options on avr-gcc
From: |
Christopher X. Candreva |
Subject: |
Re: [avr-gcc-list] Options on avr-gcc |
Date: |
Mon, 12 Feb 2007 12:16:26 -0500 (EST) |
On Mon, 12 Feb 2007, Javier Almansa Sobrino wrote:
> uint16_t n;
> for (n = 0; n < 1000; n++); /* Delay loop */
> --- rest of code --
>
> originally, this piece of code generates a delay loop, but I've changed
> the AVR-GCC options on my Makefile and now, if I want the delay loop
> works correctly, I must declare n as volatile.
Most likely any optimization at all will remove the loop. Having n volatile
is probably preferable to running unoptimized code.
==========================================================
Chris Candreva -- address@hidden -- (914) 948-3162
WestNet Internet Services of Westchester
http://www.westnet.com/