projects
/
pub
/
USBasp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Turn off watchdog before jumping to the user application in the DFU and CDC based...
[pub/USBasp.git]
/
Bootloaders
/
DFU
/
BootloaderDFU.c
diff --git
a/Bootloaders/DFU/BootloaderDFU.c
b/Bootloaders/DFU/BootloaderDFU.c
index
233e145
..
528e8cb
100644
(file)
--- a/
Bootloaders/DFU/BootloaderDFU.c
+++ b/
Bootloaders/DFU/BootloaderDFU.c
@@
-106,11
+106,18
@@
uint32_t MagicBootKey ATTR_NO_INIT;
*/
void Application_Jump_Check(void)
{
*/
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 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))
{
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;
MagicBootKey = 0;
- AppStartPtr();
+
+ // cppcheck-suppress constStatement
+ ((void (*)(void))0x0000)();
}
}
}
}