ESP8266 Restart while running ISR. [ESP8266 FreeRTOS SDK]
-
I'm trying to pass a value into Queue from Interrupt Service Routine(ISR) using
xQueueSendFromISR()
<-- ReferenceBut I'm getting this error and ESP restart immediately.
Guru Meditation Error: Core 0 panic'ed (LoadProhibited). Exception was unhandled. Core 0 register dump: PC : 0x4021227c PS : 0x00000033 A0 : 0x4021c72e A1 : 0x3ffe8220
Here is the gpio interrupt example which I'm following.
Here is my code. I did some modification in this.
Check 70th line of this location.
static void main_power_isr_handler(void* arg) { xQueueHandle* main_q = (xQueueHandle*)arg; static main_q_payload_t msg; msg.hdr = E_MAIN_MSG_MAIN_POWER_STATUS; msg.bool_payload = gpio_get_level(GPIO_MAIN_POWER); //ets_printf("Someone Interrupted \n "); xQueueSendFromISR(main_q, &msg, NULL); //!!! THIS LINE }
-
-
BaseType_t xQueueSendFromISR ( QueueHandle_t xQueue, const void *pvItemToQueue, BaseType_t *pxHigherPriorityTaskWoken );
I was trying to pass a pointer. That was the issue.
Reference -
Thanks for sharing @rafitc99 . Glad to know that it was solved.