Quote:
|
Originally Posted by Astronouth7303
If the interupt fire enough, you will want to declare it volatile. ie,
Code:
/*** Variables.h ***/
volatile unsigned char MyVar = 0;
/*** MyCode.c ***/
extern volatile unsigned char MyVar;
This will cause it to not copy the value to a temporary storage location.
|
Correct, I forgot about about the volatile keyword. You need to swap the declarations in the two files though. The extern statement goes in .h and the declaration goes in .c.
Code:
/*** Variables.h ***/
extern volatile unsigned char MyVar;
/*** MyCode.c ***/
volatile unsigned char MyVar = 0;