/* If watchdogs are enabled, the panic handler runs the risk of getting aborted pre-emptively because an overzealous watchdog decides to reset it. On the other hand, if we disable all watchdogs, we run the risk of somehow halting in the panic handler and not resetting. That is why this routine kills all watchdogs except the timer group 0 watchdog, and it reconfigures that to reset the chip after one second.  */
static void reconfigureAllWdts()
/* If watchdogs are enabled, the panic handler runs the risk of getting aborted pre-emptively because an overzealous watchdog decides to reset it. On the other hand, if we disable all watchdogs, we run the risk of somehow halting in the panic handler and not resetting. That is why this routine kills all watchdogs except the timer group 0 watchdog, and it reconfigures that to reset the chip after one second.  */
static void reconfigureAllWdts()
{
    TIMERG0.wdt_wprotect = TIMG_WDT_WKEY_VALUE;
    TIMERG0.wdt_feed = 1;
    TIMERG0.wdt_config0.sys_reset_length = 7;
    TIMERG0.wdt_config0.cpu_reset_length = 7;
    TIMERG0.wdt_config0.stg0 = TIMG_WDT_STG_SEL_RESET_SYSTEM;
    TIMERG0.wdt_config1.clk_prescale = 80 * 500;
    TIMERG0.wdt_config2 = 2000;
    TIMERG0.wdt_config0.en = 1;
    TIMERG0.wdt_wprotect = 0;
    TIMERG1.wdt_wprotect = TIMG_WDT_WKEY_VALUE;
    TIMERG1.wdt_config0.en = 0;
    TIMERG1.wdt_wprotect = 0;
}