X-Git-Url: http://git.linex4red.de/pub/lufa.git/blobdiff_plain/4c637c93ba69e33c77034eef9bd4433252e139fc..a09cb7e3d8d6256f5610459ee8dd80e0efd741f7:/Bootloaders/Printer/BootloaderPrinter.c diff --git a/Bootloaders/Printer/BootloaderPrinter.c b/Bootloaders/Printer/BootloaderPrinter.c index 151d16f92..0add1b724 100644 --- a/Bootloaders/Printer/BootloaderPrinter.c +++ b/Bootloaders/Printer/BootloaderPrinter.c @@ -152,8 +152,19 @@ void Application_Jump_Check(void) if (!(MCUSR & (1 << EXTRF)) || (MagicBootKey == MAGIC_BOOT_KEY)) JumpToApplication = true; + /* Clear reset source */ MCUSR &= ~(1 << EXTRF); } + else + { + /* If the reset source was the bootloader and the key is correct, clear it and jump to the application; + * this can happen in the HWBE fuse is set, and the HBE pin is low during the watchdog reset */ + if ((MCUSR & (1 << WDRF)) && (MagicBootKey == MAGIC_BOOT_KEY)) + JumpToApplication = true; + + /* Clear reset source */ + MCUSR &= ~(1 << WDRF); + } #endif /* Don't run the user application if the reset vector is blank (no app loaded) */