Detecting when running in an ISR ?
Cudmore, Alan P. (GSFC-5820)
alan.p.cudmore at nasa.gov
Wed Mar 28 10:48:46 CDT 2012
On our RTEMS 4.10 project ( m68k/coldfire ), I have an exception handler that does a number of things such as closing files before restarting our processor card.
This works fine when a task has an exception, but did not work too well when I caught an exception in an ISR.
I found this macro:
Which I can use to detect if the exception handler is running in an ISR. Is that a good enough way to detect that the code is running in the context of an ISR? Or is there a better/more standard way?
Another option would be to have a high priority exception task running, just waiting to handle the exception clean up activity. The exception handler could use a semaphore to kick off the task.
More information about the rtems-users