Hello.
I am using EmbOS CortexM GCC V5.02 on an ATSAM4E8C.
I have a function which I would like to take different code paths if called from a thread or from a timer or interrupt handler.
Basically my function is normally called from a task, but because it uses a MUTEX, this will fail with OS Error 161 if called from a timer handler or 160 if called from an ISR.
Is it possible to determine if my function is called from a timer or interrupt handler, so I can take a different code path, avoiding trying to acquire the mutex?
I would like to do something like the following:
Note: The function also performs a number of other things before and after the mutex, so replacing all calls from within timer and interrupt handlers with a special version is not desirable.
Best regards
Mikkel Holm Olsen
I am using EmbOS CortexM GCC V5.02 on an ATSAM4E8C.
I have a function which I would like to take different code paths if called from a thread or from a timer or interrupt handler.
Basically my function is normally called from a task, but because it uses a MUTEX, this will fail with OS Error 161 if called from a timer handler or 160 if called from an ISR.
Is it possible to determine if my function is called from a timer or interrupt handler, so I can take a different code path, avoiding trying to acquire the mutex?
I would like to do something like the following:
Best regards
Mikkel Holm Olsen