Good day All,
I have been playing with the reason for watchdog reset stuff in optiboot, but having difficulty getting a meaningful answer out.
Using the latest version of optiboot, and the following code:
// NOTE: This code will work with a recent version of 'optiboot' as the bootloader: uint8_t resetFlags __attribute__ ((section(".noinit"))); void resetFlagsInit(void) __attribute__ ((naked)) __attribute__ ((section (".init0"))); void resetFlagsInit(void) { // save the reset flags passed from the bootloader __asm__ __volatile__ ("mov %0, r2\n" : "=r" (resetFlags) :); } ... ... int(main) { ... // TODO: This will show how many resets... after the R send_string_p(PSTR("Rx LiFePO4 Charge Controller for ESP-120 PSU's. V:0.2.0. Jasper Aorangi 2014. Have a nice day 8): ")); send_uint16(resetFlags); send_string_p(PSTR(" x\r\n")); ... }
The reset flag is always '8', even when starting afresh.
I need to disable all processes and flash lights, make noises etc if reset by watchdog...
Any ideas what I am doing wrong??
Cheers
Jasper.