[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avr-gcc-list] if test ignored?
From: |
Rick Mann |
Subject: |
[avr-gcc-list] if test ignored? |
Date: |
Thu, 17 May 2007 20:39:32 -0700 |
On an AVR ATmega128:
I have two source files. In Serial.c, I define a global:
char sCommandReceived;
in the corresponding Serial.h file, I have:
extern char sCommandReceived;
sCommandReceived is set to 1 when enough bytes have been copied into
a buffer from the serial port. In main.c, which includes Serial.h, I
have:
while (true)
{
if (sCommandReceived)
{
parseCommand();
}
}
If I break on the if statement, gdb tells me that sCommandReceived is
1. However, a breakpoint in parseCommand(), defined earlier in the
file, never gets called. If I call parseCommand() directly from the
USART receive interrupt handler, it gets called. (parseCommand() then
clears sCommandReceived).
What am I missing?
TIA,
--
Rick
- [avr-gcc-list] if test ignored?,
Rick Mann <=