|
|
|
@ -193,21 +193,6 @@ void main(void) |
|
|
|
|
uint32_t ticks_time = rtc_get_counter_val(); // get time from internal RTC (since first start/power up)
|
|
|
|
|
printf("uptime: %02lu:%02lu:%02lu\n", ticks_time/(60*60), (ticks_time%(60*60))/60, (ticks_time%60)); // display time
|
|
|
|
|
|
|
|
|
|
#if !(DEBUG) |
|
|
|
|
//setup watchdog to reset in case we get stuck (i.e. when an error occurred)
|
|
|
|
|
printf("setup watchdog (%.2fs): ",WATCHDOG_PERIOD/1000.0); |
|
|
|
|
iwdg_set_period_ms(WATCHDOG_PERIOD); // set independent watchdog period
|
|
|
|
|
iwdg_start(); // start independent watchdog
|
|
|
|
|
printf("OK\n"); |
|
|
|
|
if (FLASH_OBR&FLASH_OBR_OPTERR) { |
|
|
|
|
printf("option bytes not set in flash: software wachtdog used (not started at reset)\n"); |
|
|
|
|
} else if (FLASH_OBR&FLASH_OBR_WDG_SW) { |
|
|
|
|
printf("software wachtdog used (not started at reset)\n"); |
|
|
|
|
} else { |
|
|
|
|
printf("hardware wachtdog used (started at reset)\n"); |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
// main loop
|
|
|
|
|
printf("command input: ready\n"); |
|
|
|
|
bool action = false; // if an action has been performed don't go to sleep
|
|
|
|
|