[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Re: loop deleted using optimization
From: |
Joerg Wunsch |
Subject: |
Re: [avr-gcc-list] Re: loop deleted using optimization |
Date: |
Wed, 7 Mar 2007 21:02:13 +0100 (MET) |
Ben Jackson <address@hidden> wrote:
> It would probably work to add an empty asm, as long as you used the
> __volatile attribute to scare gcc away from reordering code in the
> loop.
asm volatile(:::"memory");
works. However, as others already noted, the functions from
<util/delay.h> are preferrable, as their execution cycle count is
simply known beforehand.
--
cheers, J"org .-.-. --... ...-- -.. . DL8DTL
http://www.sax.de/~joerg/ NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)