mirror of
https://github.com/espressif/esp-idf.git
synced 2026-04-27 19:13:21 +00:00
fix(esp_system): Allow esp_task_wdt_reconfigure() if timer is stopped
If Task WDT is initialised but not start, the call to esp_timer_stop() in the reconfigure path returns ESP_ERR_INVALID_STATE and reconfiguring the Task WDT fails. This isn't the case when the Timer Group is used for Task WDT. (This failure cascades into the failure due to disabled interrupts, fixed in the parent commit.) Signed-off-by: Angus Gratton <angus@redyak.com.au>
This commit is contained in:
committed by
Omar Chebib
parent
d20510719a
commit
b9cbbf9bfe
@@ -126,7 +126,7 @@ esp_err_t esp_task_wdt_impl_timer_stop(twdt_ctx_t obj)
|
||||
ret = ESP_ERR_INVALID_STATE;
|
||||
}
|
||||
|
||||
if (ret == ESP_OK) {
|
||||
if (ret == ESP_OK && esp_timer_is_active(ctx->sw_timer)) {
|
||||
ret = esp_timer_stop(ctx->sw_timer);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user