From: Mahavir Jain <mahavir@espressif.com>
Date: Wed, 29 Aug 2018 06:09:04 +0000 (+0530)
Subject: task_wdt: correct critical section API in ISR context
X-Git-Tag: v3.2-beta1~146^2~2
X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b0ef95b6eb82a8803650b6bb42e9c1ee42b43d79;p=esp-idf

task_wdt: correct critical section API in ISR context

Signed-off-by: Mahavir Jain <mahavir@espressif.com>
---

diff --git a/components/esp32/task_wdt.c b/components/esp32/task_wdt.c
index 7e8883bdfd..3058537303 100644
--- a/components/esp32/task_wdt.c
+++ b/components/esp32/task_wdt.c
@@ -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);
 }
 
 /*