avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] winavr problem


From: Steven Michalske
Subject: Re: [avr-gcc-list] winavr problem
Date: Thu, 13 Sep 2007 14:35:41 -0700

I feel that the problem he is seeing is that he is trying to change that global and gcc is optimizing it away

try

volatile uint8_t var_a;

setting it to zero at the beginning is not required and not helpful.
see
http://www.nongnu.org/avr-libc/user-manual/FAQ.html#faq_varinit

As for future issues, a code snippet always helps.
code crosses all language barriers.

Steve


On Sep 13, 2007, at 2:26 PM, Eric Weddington wrote:



-----Original Message-----
From:
address@hidden
[mailto:address@hidden
org] On Behalf Of ali soulla
Sent: Tuesday, September 11, 2007 2:25 PM
To: address@hidden
Subject: [avr-gcc-list] winavr problem

hi
i want to do a project in winavr by ATmeag128 i see a bad bug
that confused me .
when i set my global var in start of code to zero (var_a = 0;)
for example after #includes
my code does not work correct and some variable that use var_a
give a constant value and i can not change  them
i run that code on ATmega32 and there was any problem
please suggest me what to do
thanks

You need to post your code so we can understand what you are referring to.




_______________________________________________
AVR-GCC-list mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list





reply via email to

[Prev in Thread] Current Thread [Next in Thread]