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.
I have a routine in my main program file for displaying float values on terminal program. When i try to use the same routine in my Interrupt service routine(ISR), it give an warning stating "Reference made to unresolved function". Secondly i also wanted to know how can i use a global variable in the ISR as its not possible to pass a parameter from any routine to the ISR.
Secondly i also wanted to know how can i use a global variable in the ISR Just do it. But be sure not to use a multi-byte variable, or if you do, read up on multi-threaded programming techniques like "semaphores a better search word might be "atomic" Erik
Also study the volatile keyword. A global variable shared between an ISR and main code should be declared volatile.
"A global variable shared between an ISR and main code should be declared volatile." Note that this is in addition to Hans-Bernhard & Erik's notes about "atomic" accesses - not an alternative!