I have defined a global variable named "ledFlag" in one source file, this source file also has a ISR for push button connect to Interupt pin. The ledFlag variable will be set in ISR once the push button is pressed. Since the main application is in another source file i have decalred the ledFlag as extern in the application file. But i get undfefined reference to the variable error. How can i fix it? I am using Source Insight for editing the source files.
Source file 1:
UINT32 ledFlag=0;
void ISR()
{
status = readGpio...
if (status == High)
{
ledFlag = 1;
}
else
{}
}
Source file 2:
extern UINT32 ledFlag;
main()
{
if (ledFlag)
dothis;
}
//rough illustration.