Skip to content

Commit

Permalink
Updated watchdog to IDF v5.1 API
Browse files Browse the repository at this point in the history
  • Loading branch information
PBrunot committed May 26, 2024
1 parent abbf12c commit 6aa3d7a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/test_mqtt/test_mqtt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,10 @@ namespace fabomatic::tests
{
if (!initialized)
{
auto secs = std::chrono::duration_cast<std::chrono::seconds>(conf::tasks::WATCHDOG_TIMEOUT).count();
TEST_ASSERT_EQUAL_MESSAGE(ESP_OK, esp_task_wdt_init(secs, true), "taskEspWatchdog - esp_task_wdt_init failed");
ESP_LOGI(TAG3, "taskEspWatchdog - initialized %d seconds", secs);
constexpr auto msecs = std::chrono::duration_cast<std::chrono::seconds>(conf::tasks::WATCHDOG_TIMEOUT).count();
constexpr esp_task_wdt_config_t conf{.timeout_ms = msecs, .idle_core_mask = 0, .trigger_panic = true};
TEST_ASSERT_EQUAL_MESSAGE(ESP_OK, esp_task_wdt_init(&conf), "taskEspWatchdog - esp_task_wdt_init failed");
ESP_LOGI(TAG3, "taskEspWatchdog - initialized %lld seconds", msecs);
TEST_ASSERT_EQUAL_MESSAGE(ESP_OK, esp_task_wdt_add(NULL), "taskEspWatchdog - esp_task_wdt_add failed");
initialized = true;
}
Expand Down

0 comments on commit 6aa3d7a

Please sign in to comment.