detection of int or task-context

lucky-joe wrote on Saturday, February 03, 2007:

Hi @all,

does anyone know how to detect whether the actual context is interrupt oder task-context ?

I want to implement an RTOS-wrapper and only want to have one function for semsignal and want to detect in this function if the actual context is interrupt or task-context to call the appropriate function !

regards
Joe

nobody wrote on Saturday, February 03, 2007:

that would depend on which port you are using
the easiest way would be to increment a var on entry to interrupt and decrement it again on exit.  When the var is zero the context is task

lucky-joe wrote on Saturday, February 03, 2007:

I am using an arm7tdmsi Lpc2290 from nxp