task_wdt: correct critical section API in ISR context

Signed-off-by: Mahavir Jain <mahavir@espressif.com>
This commit is contained in:
Mahavir Jain
2018-08-29 11:39:04 +05:30
parent 25c8ecaaf5
commit b0ef95b6eb

View File

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