Hello,
I have added a call to uxTaskGetSystemState() within an ISR on an ARM M4. Is this recommended/safe?
Many Thanks,
Vince
It’s not since it calls pvPortMalloc
and sprintf
internally which are usually not possible in ISRs. See the source of this function in FreeRTOS-Kernel/tasks.c at main · FreeRTOS/FreeRTOS-Kernel · GitHub.
Also note the basic rule that only FreeRTOS API calls with the FromISR suffix can be used in ISRs.
Many Thanks for the response Hartmut!
It is also quite a lengthy function, which, depending on the rest of your system, can be an issue for an ISR.