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:
Angus Gratton
2026-01-21 11:33:59 +11:00
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);
}