Commit 166142c
Clear reset flags before starting bootloader
Since the bootloader does not touch these flags, but can start the
sketch if instructed by the programmer (without a reset), clearing is
needed to prevent a start from the bootloader looking like a
software-reset. Otherwise, the startup code would be looking at the
BootIntoBootloaderAfterReset variable to decide whether to jump to the
bootloader. This variable should have been cleared before jumping to the
bootloader the last time, but the bootloader might have overwritten it
(or a sketch was uploaded with a different address for that variable).
Additionally, clearing the reset flags allows a sketch to see that the
they are started through the bootloader, when all reset flags are
cleared.1 parent e6d2d68 commit 166142c
1 file changed
+2
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| 122 | + | |
| 123 | + | |
122 | 124 | | |
123 | 125 | | |
124 | 126 | | |
| |||
0 commit comments