AnsweredAssumed Answered

Include

Question asked by planta on May 29, 2008
Latest reply on May 29, 2008 by Brett Wallace
I'm trying to learn the C language for microcontrollers but I'm facing a problem that I can not see the solution. I started an application using the CodeWarrior Processor Expert and after setting the pins, interruptions and so one, it generated two files named MCUinit.c and MCUinit.h and besides main.c,
libraries (include) files and others.
My intention is to generate a file type ".c", ".h", ".inc" or another (because I haven't had success yet) where I will place the global variables and/or functions that could be accessed by all files of the program (main.c, MCUinit.c).
I created a ".h" (and also tested as".c") file with definitions of  global variables but only file main.c can use this variables without problems while the file MCUinit.c returns the message that the variable was not declared.
If I include the same filte intto MCUinit.c file it returns that the variables had already been declared.
The microcintroller is MC9S08QG8
Could someone help me?
Thanks a lot.

Outcomes