From: Stephan Baerwolf Date: Wed, 1 Aug 2012 23:11:54 +0000 (+0200) Subject: optimize: this changes logik from commit c99e4b0f4e8dc636060fca152df271298caa8342... X-Git-Tag: 2010-07-27-stephan-201208020130~2 X-Git-Url: http://git.linex4red.de/pub/USBaspLoader.git/commitdiff_plain/9f0d56a90b51bf95bc5d5d65d98a3de5ab79c4f7?ds=sidebyside optimize: this changes logik from commit c99e4b0f4e8dc636060fca152df271298caa8342 to save bytes Signed-off-by: Stephan Baerwolf --- diff --git a/firmware/main.c b/firmware/main.c index 4a94194..b7b3f58 100644 --- a/firmware/main.c +++ b/firmware/main.c @@ -111,8 +111,6 @@ static uchar currentRequest; static const uchar currentRequest = 0; #endif -static unsigned char wdtstatus; - static const uchar signatureBytes[4] = { #ifdef SIGNATURE_BYTES SIGNATURE_BYTES @@ -146,8 +144,6 @@ static void leaveBootloader() GICR = (1 << IVCE); /* enable change of interrupt vectors */ GICR = (0 << IVSEL); /* move interrupts to application flash section */ - WDTCR = wdtstatus; - /* We must go through a global function pointer variable instead of writing * ((void (*)(void))0)(); * because the compiler optimizes a constant 0 to "rcall 0" which is not @@ -333,8 +329,6 @@ uchar i = 0; int __attribute__((noreturn)) main(void) { /* initialize */ - wdtstatus = WDTCR; - wdt_disable(); /* main app may have enabled watchdog */ bootLoaderInit(); odDebugInit(); DBG1(0x00, 0, 0); @@ -343,6 +337,7 @@ int __attribute__((noreturn)) main(void) GICR = (1 << IVSEL); /* move interrupts to boot flash section */ #endif if(bootLoaderCondition()){ + wdt_disable(); /* main app may have enabled watchdog */ #if BOOTLOADER_CAN_EXIT uchar i = 0, j = 0; #endif