--- In AVR-Chat@yahoogroups.com, "Cat C" <catalin_cluj@...> wrote:
> ... It works fine if I declare like this:
> volatile uint8_t iCh1 = 0, iCh2 = 0, ...
> but not if I change them to an array ...
> volatile uint8_t iCh[6] = {0, 0, 0, 0, 0, 0};
> ... what can I do?
Try building up the type using consecutive typedefs. Start by creating
a type for a volatile variant of uint8_t, perhaps:
typedef volatile uint8_t vuint8_t;
and then define an array of those:
vuint8_t iCh[6] = {0, 0, 0, 0, 0, 0};
At least this way you can be sure that volatile "sticks" to the right
part of the type. Maybe report back if this makes a difference?
Graham.Message
Re: Help: volatile variable versus volatile array for ISR access
2007-11-03 by Graham Davies