WORKfix: Change condition when to evaluate RAMEND
authorStephan Baerwolf <stephan.baerwolf@tu-ilmenau.de>
Tue, 10 Sep 2013 16:03:34 +0000 (18:03 +0200)
committerStephan Baerwolf <stephan.baerwolf@tu-ilmenau.de>
Tue, 10 Sep 2013 16:23:27 +0000 (16:23 +0000)
In cases users do not want to wait for a watchdog to time out,
they can ijmp to bootloaders reset-vector.
However they need to clear MCUCSR.

Signed-off-by: Stephan Baerwolf <stephan.baerwolf@tu-ilmenau.de>
firmware/bootloaderconfig.h

index e3520b4..b4a47e4 100644 (file)
@@ -389,7 +389,8 @@ static volatile uint8_t __BOOTLOADERENTRY_FROMSOFTWARE__bootup_MCUCSR __attribut
 
 static inline bool bootLoaderCondition(void)
 {
-  if (__BOOTLOADERENTRY_FROMSOFTWARE__bootup_MCUCSR & (_BV(WDRF))) {
+  if (__BOOTLOADERENTRY_FROMSOFTWARE__bootup_MCUCSR & (~(_BV(WDRF)))) {
+  } else {
     if (__BOOTLOADERENTRY_FROMSOFTWARE__bootup_RAMEND_doesmatch == (__BOOTLOADERENTRY_FROMSOFTWARE__EXPECTEDADDRESS & 0xff)) {
       // anything else: match - the firmware is calling the bootloader
       return true;