Re: [avr-gcc-list] RE: Program Space String & optimization
From:
bolet (sent by Nabble.com)
Subject:
Re: [avr-gcc-list] RE: Program Space String & optimization
Date:
Thu, 15 Dec 2005 02:54:11 -0800 (PST)
>In any case, changing the declaration of 'a' to something like
>
> unsigned char volatile a;
>
>should do it. Removing 'a' entirely should fix it as well, but I'm assuming
>you're using it for other reasons.
Thanks for your answer, the 'a' is only used for debugging purposes.
I first tried the 'do-while' loop whithout the 'a' with the same result.
The answer given by Joerg Wunsch works OK, I was using the volatile qualifier
incorrectly:
>Your volatile qualifier is at the wrong place. You're marking the
>object "txt" points to as volatile, not the pointer itself. Change
>that into
>
>PGM_P volatile txt = P_Txt;
>
>and it will work.