Don't malloc wdt_config

This commit is contained in:
Mikhael Skvortsov 2025-03-28 12:39:27 +03:00
parent 30043d5622
commit 0645c44006

View File

@ -164,10 +164,11 @@ void esp32Setup()
// #define APP_WATCHDOG_SECS 45
#define APP_WATCHDOG_SECS 90
esp_task_wdt_config_t *wdt_config = (esp_task_wdt_config_t *)malloc(sizeof(esp_task_wdt_config_t));
wdt_config->timeout_ms = APP_WATCHDOG_SECS * 1000;
wdt_config->trigger_panic = true;
res = esp_task_wdt_init(wdt_config);
esp_task_wdt_config_t wdt_config = {
.timeout_ms = APP_WATCHDOG_SECS * 1000,
.trigger_panic = true,
};
res = esp_task_wdt_init(&wdt_config);
assert(res == ESP_OK);
res = esp_task_wdt_add(NULL);