From 4c35c3b6d7988c8f7ff5d33c4df608cfd7b85442 Mon Sep 17 00:00:00 2001 From: Stephan Baerwolf Date: Tue, 10 Sep 2013 15:49:29 +0200 Subject: [PATCH] BUGfix: Only clear MCUCSR register when bootLoaderCondition() If bootLoaderCondition() is false, the users firmware must be started transparently - so leave the register for it to read! Signed-off-by: Stephan Baerwolf --- firmware/bootloaderconfig.h | 2 -- firmware/main.c | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/firmware/bootloaderconfig.h b/firmware/bootloaderconfig.h index 9ca2cd1..e3520b4 100644 --- a/firmware/bootloaderconfig.h +++ b/firmware/bootloaderconfig.h @@ -358,8 +358,6 @@ static inline void bootLoaderInit(void) // deactivated by Stephan - reset after each avrdude op is annoing! // if(!(MCUCSR & (1 << EXTRF))) /* If this was not an external reset, ignore */ // leaveBootloader(); - - MCUCSR = 0; /* clear all reset flags for next time */ } static inline void bootLoaderExit(void) diff --git a/firmware/main.c b/firmware/main.c index 99bbb20..fe7d049 100644 --- a/firmware/main.c +++ b/firmware/main.c @@ -707,6 +707,7 @@ int __attribute__((__noreturn__)) main(void) # endif wdt_disable(); /* main app may have enabled watchdog */ #endif + MCUCSR = 0; /* clear all reset flags for next time */ initForUsbConnectivity(); do{ usbPoll(); -- 2.11.0