esp_system: Update task watchdog unit tests and example

This commit does the following:

- Update existing unit tests that use the TWDT to call the new
  esp_task_wdt_init() API
- Add a set of dedicate TWDT unit tests
- Updates the TWDT example
This commit is contained in:
Darian Leung
2022-04-14 18:56:02 +08:00
parent 5953bca376
commit 7c02bde904
6 changed files with 209 additions and 88 deletions
@@ -216,8 +216,12 @@ TEST_CASE_MULTIPLE_STAGES("reset reason ESP_RST_INT_WDT after interrupt watchdog
static void do_task_wdt(void)
{
setup_values();
esp_task_wdt_init(1, true);
esp_task_wdt_add(xTaskGetIdleTaskHandleForCPU(0));
esp_task_wdt_config_t twdt_config = {
.timeout_ms = 1000,
.idle_core_mask = (1 << 0), // Watch core 0 idle
.trigger_panic = true,
};
TEST_ASSERT_EQUAL(ESP_OK, esp_task_wdt_init(&twdt_config));
while(1);
}