2018-04-04 09:25:47 +02:00
|
|
|
/******************************************************************************
|
|
|
|
* WDT api for NodeMCU
|
|
|
|
* NodeMCU Team
|
|
|
|
* 2018-04-04
|
|
|
|
*******************************************************************************/
|
|
|
|
|
|
|
|
#include "platform.h"
|
|
|
|
#include "esp_task_wdt.h"
|
|
|
|
|
2023-01-31 07:07:54 +01:00
|
|
|
int platform_wdt_feed( void )
|
|
|
|
{
|
2018-04-04 09:25:47 +02:00
|
|
|
#ifdef CONFIG_TASK_WDT
|
2023-01-31 07:07:54 +01:00
|
|
|
esp_task_wdt_config_t cfg = {
|
|
|
|
.timeout_ms = CONFIG_TASK_WDT_TIMEOUT_S * 1000,
|
|
|
|
.idle_core_mask = (uint32_t)-1,
|
|
|
|
.trigger_panic =
|
2018-04-04 09:25:47 +02:00
|
|
|
#ifdef CONFIG_TASK_WDT_PANIC
|
2023-01-31 07:07:54 +01:00
|
|
|
true,
|
2018-04-04 09:25:47 +02:00
|
|
|
#else
|
2023-01-31 07:07:54 +01:00
|
|
|
false,
|
2018-04-04 09:25:47 +02:00
|
|
|
#endif
|
2023-01-31 07:07:54 +01:00
|
|
|
};
|
|
|
|
return esp_task_wdt_init(&cfg) == ESP_OK ? PLATFORM_OK : PLATFORM_ERR;
|
2018-04-04 09:25:47 +02:00
|
|
|
#else
|
|
|
|
return PLATFORM_OK;
|
|
|
|
#endif
|
|
|
|
}
|