]> granicus.if.org Git - esp-idf/commitdiff
task_wdt: correct critical section API in ISR context
authorMahavir Jain <mahavir@espressif.com>
Wed, 29 Aug 2018 06:09:04 +0000 (11:39 +0530)
committerMahavir Jain <mahavir@espressif.com>
Mon, 17 Sep 2018 10:41:15 +0000 (16:11 +0530)
Signed-off-by: Mahavir Jain <mahavir@espressif.com>
components/esp32/task_wdt.c

index 7e8883bdfd93327033f3be53ecf618a24f5cd7f5..30585373039f90b017b0025334903972124e4b7d 100644 (file)
@@ -135,7 +135,7 @@ void __attribute__((weak)) esp_task_wdt_isr_user_handler(void)
  */
 static void task_wdt_isr(void *arg)
 {
-    portENTER_CRITICAL(&twdt_spinlock);
+    portENTER_CRITICAL_ISR(&twdt_spinlock);
     twdt_task_t *twdttask;
     const char *cpu;
     //Reset hardware timer so that 2nd stage timeout is not reached (will trigger system reset)
@@ -169,12 +169,12 @@ static void task_wdt_isr(void *arg)
     esp_task_wdt_isr_user_handler();
     if (twdt_config->panic){     //Trigger Panic if configured to do so
         ESP_EARLY_LOGE(TAG, "Aborting.");
-        portEXIT_CRITICAL(&twdt_spinlock);
+        portEXIT_CRITICAL_ISR(&twdt_spinlock);
         esp_reset_reason_set_hint(ESP_RST_TASK_WDT);
         abort();
     }
 
-    portEXIT_CRITICAL(&twdt_spinlock);
+    portEXIT_CRITICAL_ISR(&twdt_spinlock);
 }
 
 /*