Page 1 of 1

How to know if inside interrupt ?

Posted: Tue May 08, 2018 1:27 am
by solution-ice
Hi, I have a library for inter task communication that uses FreeRTOS queues, but I need to know if it was called from inside interrupt to call the right function. Under STM32 I can use this:
if ((SCB->ICSR & SCB_ICSR_VECTACTIVE_Msk) != 0)

Is there something similar under ESP32 ?

Thanks
Frank

Re: How to know if inside interrupt ?

Posted: Tue May 08, 2018 3:08 am
by ESP_Angus
Yes, there's a FreeRTOS function called xPortInIsrContext() which returns true if the calling CPU is inside an ISR.