All the routines below live in one C file. Would we need to declare a file global variable xyz as: static volatile char xyz = 100; ..or.. static char xyz = 100; ?Basically does the fact that all the routines live in one file allow the compile to "know" xyz is used among multiple functions, and thus needs to be read each time it is needed?
void Task1(void)
{
while( xyz >= 12 )
{
... some code ...
}
}
void Task2(void)
{
while( 1 )
{
... some code that changes the value of xyz ...
}
}
void MyHwISR(void)
{
... some code that sets a value to xyz ...
}
Thanks, Dean