mirror of https://github.com/noisymime/Arduino.git
Improved Leonardo bootloader
The power-on reset detection didn't work properly, but has now been fixed
This commit is contained in:
parent
554c211ec4
commit
ef6f1eb11d
File diff suppressed because it is too large
Load Diff
|
@ -123,11 +123,11 @@ int main(void)
|
||||||
|
|
||||||
if (mcusr_state & (1<<EXTRF)) {
|
if (mcusr_state & (1<<EXTRF)) {
|
||||||
// External reset - we should continue to self-programming mode.
|
// External reset - we should continue to self-programming mode.
|
||||||
} else if (mcusr_state == (1<<PORF) && pgm_read_word(0) != 0xFFFF) {
|
} else if ((mcusr_state & (1<<PORF)) && (pgm_read_word(0) != 0xFFFF)) {
|
||||||
// After a power-on reset skip the bootloader and jump straight to sketch
|
// After a power-on reset skip the bootloader and jump straight to sketch
|
||||||
// if one exists.
|
// if one exists.
|
||||||
StartSketch();
|
StartSketch();
|
||||||
} else if ((mcusr_state == (1<<WDRF)) && (bootKeyPtrVal != bootKey) && (pgm_read_word(0) != 0xFFFF)) {
|
} else if ((mcusr_state & (1<<WDRF)) && (bootKeyPtrVal != bootKey) && (pgm_read_word(0) != 0xFFFF)) {
|
||||||
// If it looks like an "accidental" watchdog reset then start the sketch.
|
// If it looks like an "accidental" watchdog reset then start the sketch.
|
||||||
StartSketch();
|
StartSketch();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue