AnsweredAssumed Answered

Crazy function for local scope: help!

Question asked by ciccio unico on Sep 26, 2008
Latest reply on Sep 30, 2008 by ciccio unico
Hi,
I use MC9S08LC36.
I have make a function defined in funcs.h :
void CaricoOre(unsigned char );

I use this function and I pass it a global var defined in ram.h with:

#ifdef _MAIN_C
   #define g_var
#else
   #define g_var extern
#endif

g_var unsigned char ore;

My problem is: when I call My function, the var passed is 0 but insiede the function is random value!!
Why?
The screen shot: call function
http://ciccioamore.altervista.org/1.jpg

Inside the function:
http://ciccioamore.altervista.org/2.jpg





Thanks

Outcomes