How to properly feed WDT
Posted: Thu May 16, 2019 5:12 am
- #include "esp_task_wdt.h"
- void setup() {
- Serial.begin( 1000000 );
- BaseType_t result = xTaskCreatePinnedToCore( handleOtherThings, "handleOtherThings", 20000, NULL, 1, NULL, 0 );
- }
- void handleOtherThings( void* param ) {
- while( true ){
- esp_task_wdt_reset();
- }
- }
- void loop() {
- // put your main code here, to run repeatedly:
- }
However, WDT reset keep triggered.
Nothing changes if I use yield() instead of esp_task_wdt_reset();
However, if i change esp_task_wdt_reset() to vTaskDelay( 10 / portTICK_PERIOD_MS ), then no more WDT reset, but I don't want 10ms delay for my task.
delay(1); also resets WDT timer but I also do not want it be delayed for 1ms.
delay( 0 ); do not reset WDT timer.
delayMicroseconds( 100 ); do not reset WDT timer.
What would be the minimal and proper way to reset WDT timer in ESP32-arduino?