From: Stephan Baerwolf Date: Tue, 10 Sep 2013 16:03:34 +0000 (+0200) Subject: WORKfix: Change condition when to evaluate RAMEND X-Git-Tag: testing-head~25 X-Git-Url: http://git.linex4red.de/pub/USBaspLoader.git/commitdiff_plain/00602eff344e2d55b948039f64e1704b392624a0?ds=inline WORKfix: Change condition when to evaluate RAMEND 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 --- diff --git a/firmware/bootloaderconfig.h b/firmware/bootloaderconfig.h index e3520b4..b4a47e4 100644 --- a/firmware/bootloaderconfig.h +++ b/firmware/bootloaderconfig.h @@ -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;