[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Function specific volatile
From: |
Anton Erasmus |
Subject: |
Re: [avr-gcc-list] Function specific volatile |
Date: |
Mon, 28 Apr 2003 23:11:30 +0200 |
On 03/04/28 at 09:31 Dmitry K. wrote:
>27 Apr 2003 07:06 Anton Erasmus:
>> On 03/04/26 at 01:08 Mark Williams (MWP) wrote:
>> >Hi all...
>> >
>> >Is there a way to force a global non-volatile var to be considered
>> >volatile in a specific function (int handler)?
>> >
>> >This would be handy for variables that are only read in int handlers.
>> >
>> >Thanks,
>> >Mark.
>>
>> Just do a cast.
>>
>> int foo;
>>
>> void Intfunc(void)
>> {
>> int i;
>>
>> i=(volatile int)foo;
>> }
>>
>>
>> Regards
>> Anton Erasmus
>
>------------------------------------------------------------------
>No, true is:
> * (volatile int *) &foo
>------------------------------------------------------------------
>
[Example Snipped]
Thanks,
I forgot that the "reference" should be cast,
NOT the variable as I did.
Regards
Anton