mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-02 12:14:32 +02:00
fix(wdt): fixed potential WDT timeout when deinitializing task watchdog
If task WDT deinit was called from core 1 it would cause an interrupt WDT timeout
This commit is contained in:
@@ -252,10 +252,14 @@ esp_err_t esp_task_wdt_deinit(void)
|
|||||||
//Disable hardware timer
|
//Disable hardware timer
|
||||||
wdt_hal_deinit(&twdt_context);
|
wdt_hal_deinit(&twdt_context);
|
||||||
|
|
||||||
ESP_ERROR_CHECK(esp_intr_free(twdt_config->intr_handle)); //Unregister interrupt
|
/* Need to exit critical section to free interrupt (potential IPC call), store and clear config before exiting */
|
||||||
free(twdt_config); //Free twdt_config
|
twdt_config_t *twdt_config_temp = twdt_config;
|
||||||
twdt_config = NULL;
|
twdt_config = NULL;
|
||||||
portEXIT_CRITICAL(&twdt_spinlock);
|
portEXIT_CRITICAL(&twdt_spinlock);
|
||||||
|
|
||||||
|
ESP_ERROR_CHECK(esp_intr_free(twdt_config_temp->intr_handle)); //Unregister interrupt
|
||||||
|
free(twdt_config_temp); //Free twdt_config
|
||||||
|
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user