summaryrefslogtreecommitdiff
path: root/firmware/src/start/Cstartup.S
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2010-11-13 17:25:43 +0100
committerHarald Welte <laforge@gnumonks.org>2010-11-13 17:25:43 +0100
commitcad600d12ca89b3f2632c7d3263ab597d97c5149 (patch)
tree84e747a12aa1a9c9ccf34e1b7f954d08ceb1c50b /firmware/src/start/Cstartup.S
parent6aebaca5016ca076294d3b6f2c3540e9fb8f518f (diff)
On the Olimex board, the buttons are low-active
Thus, we need to invert our check during the dfu / main dual boot decision
Diffstat (limited to 'firmware/src/start/Cstartup.S')
-rw-r--r--firmware/src/start/Cstartup.S8
1 files changed, 7 insertions, 1 deletions
diff --git a/firmware/src/start/Cstartup.S b/firmware/src/start/Cstartup.S
index 83e7696..a28b400 100644
--- a/firmware/src/start/Cstartup.S
+++ b/firmware/src/start/Cstartup.S
@@ -95,9 +95,11 @@
#elif defined(PICC)
.equ PIO_BOOTLDR, (1 << 6)
#elif defined(OLIMEX)
+ /* Olimex SAM7-Pxxx boards have a button B1 on PA19 that is low-active */
.equ PIO_BOOTLDR, (1 << 19)
+#define CONFIG_DFU_SWITCH_INV
#else
-#error please define PIO_BOOTLDR
+#error please define PIO_BOOTLDR for your board
#endif
@@ -373,7 +375,11 @@ LoopZI: CMP R1, R2
ldr r1, =AT91C_BASE_PIOA
ldr r2, [r1, #PIOA_PDSR]
tst r2, #PIO_BOOTLDR
+#ifdef CONFIG_DFU_SWITCH_INV
+ beq _reloc_dfu
+#else
bne _reloc_dfu
+#endif /* SWITCH_INV */
#endif
bx r10
personal git repositories of Harald Welte. Your mileage may vary