Answers for "watchdog timer esp32"

C++
0

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
}
Posted by: Guest on October-04-2021

Browse Popular Code Answers by Language