I am using STM32F103 and and Keil for the Compiler. Here is my summary code: There is a header file like abc.h and abc file has a static variable. abc.h is like that:
static uint8 a;
And there is a function in another header file which named abcd.h and that changes the a' s value. abcd.h header file is like that.
include "abc.h"
void foo()
{
a = 0x0A;
}
My issue is that: When I call the "foo" fuction in main "a" is turn to zero even if I assign the "a" variable to 0x0A in "foo()" function. By the way, If I define the "a" variable with extern and the problem does not occured. I mean "a" is get 0x0A value.
Is there anyone the help me why does this problem occur.