I have a static
variable in source file test_1.c declared as:
static char var1 = 0;
I need to access the current value of this variable from source file test_2.c. So, I did something like:
In test_1.c
static char var1 = 0;
volatile char var_another = var1;
and in test_2.c, I declare the variable var_another as extern
and access it:
extern volatile char var_another;
Is this the right way to do it?