diff options
author | Dean Camera <[email protected]> | 2012-05-21 16:37:34 +0000 |
---|---|---|
committer | Dean Camera <[email protected]> | 2012-05-21 16:37:34 +0000 |
commit | 615d34f1b7b363dc9c1cc79be6834e1e88c30ee8 (patch) | |
tree | 7f31adb7997a792eb6e2c8a7d121ee4e54660345 /Bootloaders/CDC | |
parent | 5833b27f80f4b6b10f5765468f5863e57b97a65a (diff) | |
download | qmk_firmware-615d34f1b7b363dc9c1cc79be6834e1e88c30ee8.tar.gz qmk_firmware-615d34f1b7b363dc9c1cc79be6834e1e88c30ee8.zip |
Turn off watchdog before jumping to the user application in the DFU and CDC based bootloaders, for the specific case of /HWB being low during reset (where the bootloader will re-enter).
Diffstat (limited to 'Bootloaders/CDC')
-rw-r--r-- | Bootloaders/CDC/BootloaderCDC.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Bootloaders/CDC/BootloaderCDC.c b/Bootloaders/CDC/BootloaderCDC.c index 211b054e3d..7bff89994b 100644 --- a/Bootloaders/CDC/BootloaderCDC.c +++ b/Bootloaders/CDC/BootloaderCDC.c @@ -73,7 +73,13 @@ void Application_Jump_Check(void) /* If the reset source was the bootloader and the key is correct, clear it and jump to the application */ if ((MCUSR & (1 << WDRF)) && (MagicBootKey == MAGIC_BOOT_KEY)) { + /* Turn off the watchdog */ + MCUSR &= ~(1<<WDRF); + wdt_disable(); + + /* Clear the boot key and jump to the user application */ MagicBootKey = 0; + // cppcheck-suppress constStatement ((void (*)(void))0x0000)(); } |