We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello,
I want to work with the interrupt int0 of the FX2.
The regsiters I have to use are written down in the TRM of the FX2. But where are informations about enabling the interrupt or name of the ISR for example?
Where I can search? I only find information snippets.
Best regards Jan
the only way you can communicate between a function and an ISR is having them in the same module or using a global variable
Yes, but how can I realize it making it global when I use two files which have to access this variable?
could I make it as follows: creating a new file _______________________ globalVars.h:
static volatile char var;
static char getVar() { return var; }
static incVar() { var++; }
________________________
Whenn accessing the variable from the ISR or main file I call the getVar() fucntion. Does this realization create two variables internaly too?
But was it too simple to remove the "static" keyword, thereby allowing access to the variable from other translation modules?
Then a line with "extern" to tell the compiler that someone else has a variable of this type and name that it wants to share with the world.
Surely, you must realise every 'C' program with more than 1 source file must manage to do this? It really is basic, textbook stuff!
Did you actually follow the link that I provided?
Have you actually thought about the meaning of the 'static' keyword?