summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rbutil/mkamsboot/dualboot.S21
1 files changed, 13 insertions, 8 deletions
diff --git a/rbutil/mkamsboot/dualboot.S b/rbutil/mkamsboot/dualboot.S
index 1713017060..4fac02f010 100644
--- a/rbutil/mkamsboot/dualboot.S
+++ b/rbutil/mkamsboot/dualboot.S
@@ -95,10 +95,17 @@ uclcopy:
95 95
96#ifdef SANSA_CLIP 96#ifdef SANSA_CLIP
97 /* HOME button */ 97 /* HOME button */
98.set row, (1<<6) /* enable output on C6 */
99 ldr r0, =GPIOC
100 mov r1, #row
101 str r1, [r0, #0x400]
102 str r1, [r0, #(4*row)]
103
104.set col, (1<<2) /* read keyscan column B2 */
98 ldr r0, =GPIOB 105 ldr r0, =GPIOB
99 mov r1, #0 106 mov r1, #0
100 str r1, [r0, #0x400] 107 str r1, [r0, #0x400]
101 ldr r1, [r0, #0x10] /* read pin B2 */ 108 ldr r1, [r0, #(4*col)]
102 109
103 cmp r1, #0 110 cmp r1, #0
104 bne boot_of 111 bne boot_of
@@ -112,21 +119,19 @@ uclcopy:
112 cmp r1, #0 /* C6 = #0 means button pressed */ 119 cmp r1, #0 /* C6 = #0 means button pressed */
113 beq boot_of 120 beq boot_of
114#elif defined(SANSA_M200V2) 121#elif defined(SANSA_M200V2)
115.set row, (1<<5) /* 4 or <<5 or <<6 */ 122 /* SELECT button */
116 /* enable output on A3-A5 */ 123.set row, (1<<5) /* enable output on A5 */
117 /* set keyscan row A0-A3 */
118 ldr r0, =GPIOA 124 ldr r0, =GPIOA
119 mov r1, #row 125 mov r1, #row
120 str r1, [r0, #0x400] 126 str r1, [r0, #0x400]
121 str r1, [r0, #(4*row)] 127 str r1, [r0, #(4*row)]
122 128
123.set col, (1<<0) /* 0 or 1, 2, 3 */ 129.set col, (1<<0) /* read keyscan column A0 */
124 /* read keyscan column A0-A3 */
125 ldr r2, [r0, #(4*col)] 130 ldr r2, [r0, #(4*col)]
126 131
127 /* check value read (compare to 0!) */ 132 /* check value read (0 means button pressed) */
128 cmp r2, #0 133 cmp r2, #0
129 beq boot_of /* for beginning we jump if button select is not pressed */ 134 beq boot_of
130#else 135#else
131 #error No target-specific key check defined! 136 #error No target-specific key check defined!
132#endif 137#endif