X-Git-Url: http://git.linex4red.de/pub/USBaspLoader.git/blobdiff_plain/0a72152bc35e658c622c9e18aa6e51c1e3e8f1c6..27f21b1464a7743393bb1ea88f70d687155bbe4b:/firmware/main.c diff --git a/firmware/main.c b/firmware/main.c index 87f0641..bd36e06 100644 --- a/firmware/main.c +++ b/firmware/main.c @@ -644,6 +644,15 @@ int __attribute__((__noreturn__)) main(void) #endif if(bootLoaderCondition()){ #if NEED_WATCHDOG +# if (defined(MCUSR) && defined(WDRF)) + /* + * Fix issue 6: (special thanks to coldtobi) + * + * The WDRF bit in the MCUSR needs to be cleared first, + * otherwise it is not possible to disable the watchdog + */ + MCUSR &= ~(_BV(WDRF)); +# endif wdt_disable(); /* main app may have enabled watchdog */ #endif initForUsbConnectivity();