summaryrefslogtreecommitdiff
path: root/rbutil/mkamsboot/dualboot.S
diff options
context:
space:
mode:
Diffstat (limited to 'rbutil/mkamsboot/dualboot.S')
-rw-r--r--rbutil/mkamsboot/dualboot.S16
1 files changed, 15 insertions, 1 deletions
diff --git a/rbutil/mkamsboot/dualboot.S b/rbutil/mkamsboot/dualboot.S
index 4d19b020a3..6cdc88de18 100644
--- a/rbutil/mkamsboot/dualboot.S
+++ b/rbutil/mkamsboot/dualboot.S
@@ -81,12 +81,16 @@ uclcopy:
#ifndef SANSA_M200V4 /* this doesnt work for m200 */
/* we check A3 unconditionally of the model because it seems to be */
/* either hold, either usb on every model */
+ /* TODO: make it USB on all AMS Sansas for consistency, USB is safer too */
ldr r0, =GPIOA
mov r1, #0
str r1, [r0, #0x400]
+#ifdef SANSA_C200V2
+ ldr r1, [r0, #0x8] /* USB is A1 on C200 */
+#else
ldr r1, [r0, #0x20] /* read pin A3 */
-
+#endif
cmp r1, #0
bne boot_of
#endif
@@ -118,6 +122,16 @@ uclcopy:
cmp r1, #0 /* C3 = #0 means button pressed */
beq boot_of
+#elif defined(SANSA_C200V2)
+ /* check for RIGHT on C6, should maybe changed to LEFT as soon as it
+ * known in which pin that is in order for consistency */
+ ldr r0, =GPIOC
+ mov r1, #0
+ str r1, [r0, #0x400] /* set pin to output */
+
+ ldr r1, [r0, #256] /* 1<<(6+2) */
+ cmp r1, #0 /* C6 low means button pressed */
+ beq boot_of
#elif defined(SANSA_M200V4)
/* LEFT button */
.set row, (1<<5) /* enable output on A5 */