[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
AW: [avr-gcc-list] Bug in avr-libc or?
From: |
Andreas Trenkwalder |
Subject: |
AW: [avr-gcc-list] Bug in avr-libc or? |
Date: |
Tue, 1 Jun 2004 09:59:28 +0200 |
Hello,
> What happen was that the variable in the while loop was
> copied into a register and the while loop did test the
> register instead of the variable.
> Thereby never detecting any change of the variable done in
> the interrupt routine.
>
Try to declare your variable as volatile:
volatile uint8_t var;
This indicates that a variable may be changed in a way which is
unpredictable by analysing the normal program flow (such as variable which
may be changed by an interrupt handler).
Regards,
Andreas