[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] static variables in function called via function ptr
From: |
E. Weddington |
Subject: |
Re: [avr-gcc-list] static variables in function called via function ptr |
Date: |
Tue, 04 Jan 2005 07:16:25 -0700 |
On 4 Jan 2005 at 8:18, sandeep choudhary wrote:
>
> Hi there,
> I am using a static variable in a function to save state of that
> function. I do call the function via function pointer in ISR of timer
> interrupt scheduled to fire at periodic interval. But the variable is
> not retaining its value. Can anyone please help.
>
Declare it as volatile in addition to static.
See the FAQ in the avr-libc user manual, question #1.