/*! \brief Watchdog thread */ static msg_t wdthread(void *arg) { uint16_t timeout = *((uint16_t *)arg); chRegSetThreadName("iwatchdog"); while (TRUE) { iwdg_lld_reload(); chThdSleepMilliseconds(timeout); } return -1; }
/*! \brief Watchdog thread */ static msg_t Thread_indwatchdog(void *arg) { (void)arg; chRegSetThreadName("iwatchdog"); while (TRUE) { iwdg_lld_reload(); chThdSleepMilliseconds(250); } return -1; }
/* Use this AFTER ChibiOS threads have started */ void iwdgPostStart(void) { iwdg_lld_reload(); chThdCreateStatic(wa, sizeof(wa), NORMALPRIO, wdthread, &timeout_ms); }