Hi All
I am writing a small programme where I need a couple of variables to be
accessible to various routines, including an ISR.
I have declared the variables in the main body of the programme as
volatile, as I believe that this is required for access by the ISR:
volatile uint8_t foo;
volatile uint8_t bar;
1) Am I correct in thinking that I need to declare this in the ISR thus:
SIGNAL(SIG_OUTPUT_COMPARE1A)
{
extern uint8_t foo;
foo++;
// Other stuff
}
2) Is this the correct way to access it in an ordinary routines, or
should I be doing something with references?
void startclock(void)
{
extern uint8_t bar;
// Various stuff
bar=1;
}
Comments/suggestions would be greatly appreciated.
Cheers
M
--
Matthew Smith
Work: <http://www.kbc.net.au> | Home: <http://www.mss.cx>
The time here is 11:20 and the temperature outside is 27.3°C; today's
maximum is 29.5°C with a minimum of 10.1°C. We have had 0.0mm of rain
today, with a total of 0.0mm in the last week. The wind is currently
due WSW, light air, force 1 (3.3mph), gusting to light breeze, force 2
(6.3mph).
_______________________________________________
AVR-GCC-list mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list