[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avr-gcc-list] BUG in WINAVR?
From: |
Trampas |
Subject: |
[avr-gcc-list] BUG in WINAVR? |
Date: |
Fri, 11 Aug 2006 21:02:31 -0400 |
I think I have found a bug in GCC for the AVR.
Here is the snip of code
#define K_IN ((PIND>>2) & 0x01)
while(K_IN==1) //spin waiting on sync bit
{
if (TCNT3L>250)
{
timeMs=timeMs+1;
TCNT3L=0;
}
if (timeMs>time_out_ms )
{
if (index==0)
{
printf("Error: ISO get time
out\n\r");
}
ENABLE_INTERRUPTS();
return index;
}
}
>From stepping though the code it appears that the test for K_IN==1 is done
at the end of the loop, and it appears that compiler thinks the end of the
loop is at the return. Thus the code times out each and every time I run it.
The only way I could debug the code was put a break point on the IN assembly
instruction and it appears to only be called once.
FYI this is in the April 2006 build of WinAVR.
Trampas
- [avr-gcc-list] [AVR] RTL prologue/epilogue ver.2, Anatoly Sokolov, 2006/08/11
- [avr-gcc-list] BUG in WINAVR?,
Trampas <=
- RE: [avr-gcc-list] BUG in WINAVR?, Trampas, 2006/08/11
- Re: [avr-gcc-list] BUG in WINAVR?, Royce Pereira, 2006/08/12
- [avr-gcc-list] printf using floats, Trampas, 2006/08/14
- RE: [avr-gcc-list] printf using floats, Trampas, 2006/08/14
- [avr-gcc-list] printf and printf_P suggestions, Trampas, 2006/08/15
- Re: [avr-gcc-list] printf and printf_P suggestions, Joerg Wunsch, 2006/08/15
- [avr-gcc-list] SRAM with winavr, Paulo da Silva, 2006/08/22
- RE: [avr-gcc-list] SRAM with winavr, Eric Weddington, 2006/08/22
- Re: [avr-gcc-list] SRAM with winavr, Paulo da Silva, 2006/08/22
Re: [avr-gcc-list] [AVR] RTL prologue/epilogue ver.3, Anatoly Sokolov, 2006/08/20