[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] multiplexed display question
From: |
Richard Urwin |
Subject: |
Re: [avr-gcc-list] multiplexed display question |
Date: |
Mon, 9 May 2005 00:40:29 +0100 |
User-agent: |
KMail/1.5.3 |
On Sunday 08 May 2005 8:35 pm, Radu Ciurlea wrote:
> Hello everybody. I'm just starting out with AVR microcontrollers
>
> I wrote the following program to test the whole thing:
>
> uint8_t count,div;
>What's wrong with updating count in
> main()? As far as I know updating global variables from any function
> should be okay. What am I doing wrong?
Newbie bug #1, I'm afraid.
main() doesn't bother to store the intermediate values into count.
Any variables that are accessed in interrupt functions should probably
be marked volatile.
Try using
volatile uint8_t count;
It would be best to do that for active_pin too.
--
Richard Urwin