diff options
author | Cristian Maglie <c.maglie@bug.st> | 2012-12-10 15:55:05 +0100 |
---|---|---|
committer | Cristian Maglie <c.maglie@bug.st> | 2012-12-10 15:55:05 +0100 |
commit | 433090f18b6218319fe0a721c24e1dc69285ea3e (patch) | |
tree | e7dc4da5b6ff077f1bc255350506dfc0bf87c6c3 /bootloaders/caterina/Caterina.c | |
parent | c453e0a32e7adf5e7bab7bfb7c8f7a21e30ca563 (diff) | |
parent | e624b841b3b5d22f6e9cb7ec515beb47f96f46f2 (diff) |
Merged 1.0.3
Diffstat (limited to 'bootloaders/caterina/Caterina.c')
-rw-r--r-- | bootloaders/caterina/Caterina.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bootloaders/caterina/Caterina.c b/bootloaders/caterina/Caterina.c index abcba2b..9860b3a 100644 --- a/bootloaders/caterina/Caterina.c +++ b/bootloaders/caterina/Caterina.c @@ -123,11 +123,11 @@ int main(void) if (mcusr_state & (1<<EXTRF)) {
// 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
// if one exists.
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.
StartSketch();
}
|