[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] What's wrong with this preprocessor statement
From: |
Uwe Bonnes |
Subject: |
Re: [avr-gcc-list] What's wrong with this preprocessor statement |
Date: |
Sun, 25 Feb 2001 15:54:27 +0100 |
>>>>> "Nicolas" == Nicolas Nickisch <address@hidden> writes:
Nicolas> Hi, I am trying to implement a delay-loop with the following
Nicolas> #define-statement:
Nicolas> #define delay2(microseconds) { unsigned long x; x=((( (unsigned
Nicolas> long) microseconds*F_CPU)/(13000000)));while(x--){}}
...
Nicolas> Any ideas ?
Nicolas,
did you compile with optimization? Then perhaps the loop was optimized away.
Put the "volatile" keyword before the variable and try again.
Bye
--
Uwe Bonnes address@hidden
Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------