watchdog timer esp32
#include "soc/timer_group_struct.h" //TIMERGx class access
#include "soc/timer_group_reg.h" //TIMERGx class access
/*!
\brief function to register the reset of watchdog timer (can be dangerous,
if a processor is running the same function always, this processor
cannot be used for other threads!)
*/
void feedTheDog(){
// feed dog 0
TIMERG0.wdt_wprotect=TIMG_WDT_WKEY_VALUE; // write enable
TIMERG0.wdt_feed=1; // feed dog
TIMERG0.wdt_wprotect=0; // write protect
// feed dog 1
TIMERG1.wdt_wprotect=TIMG_WDT_WKEY_VALUE; // write enable
TIMERG1.wdt_feed=1; // feed dog
TIMERG1.wdt_wprotect=0; // write protect
}