I have the independent watch dog running and I get rare resets for unknown reasons.
How can I catch these errors and do a controlled reset. I want to store some things in EEPROM and then restart the application.
Unplugging the device however, the device needs to forget everything it knows. So I only want to restore EEPROM if an error occured.
void HardFault_Handler(void){
EEPROM_save_ram();
}
void Reset_Handler(void){
EEPROM_restore_ram();
}
Is there a bit that shows me if its a warm restart? A watchdog reset? or just a normal cold start?