[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] BUG in WINAVR?
From: |
Royce Pereira |
Subject: |
Re: [avr-gcc-list] BUG in WINAVR? |
Date: |
Sat, 12 Aug 2006 16:44:32 +0530 |
User-agent: |
Opera Mail/9.01 (Win32) |
hi,
so what was the problem?
--royce
On Sat, 12 Aug 2006 08:00:36 +0530, Trampas <address@hidden> wrote:
> I went and rewrote the code and it all works now.
>
> Trampas
>
> -----Original Message-----
> From: address@hidden
> [mailto:address@hidden On Behalf Of
> Trampas
> Sent: Friday, August 11, 2006 9:03 PM
> To: address@hidden
> Subject: [avr-gcc-list] BUG in WINAVR?
>
> 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 mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/avr-gcc-list
>
>
>
> _______________________________________________
> AVR-GCC-list mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/avr-gcc-list
>
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Re: [avr-gcc-list] [AVR] RTL prologue/epilogue ver.3, Anatoly Sokolov, 2006/08/20