summaryrefslogtreecommitdiffstats
path: root/rbutil/mkamsboot/dualboot/dualboot.S
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2011-12-02 18:31:40 +0000
committerRafaël Carré <rafael.carre@gmail.com>2011-12-02 18:31:40 +0000
commit444b17626fc8e1ed7dee23252d3bd0fe5d0020f9 (patch)
tree561fd2af5e56fb3d2d9f01d9b442697a6f9d7156 /rbutil/mkamsboot/dualboot/dualboot.S
parentab76a0db287f41c100be1d467a4077fd60789d72 (diff)
downloadrockbox-444b17626fc8e1ed7dee23252d3bd0fe5d0020f9.tar.gz
rockbox-444b17626fc8e1ed7dee23252d3bd0fe5d0020f9.zip
mkamsboot: make clip zip boot OF when pressing left button
pressing vol- to boot OF is still possible git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31112 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil/mkamsboot/dualboot/dualboot.S')
-rw-r--r--rbutil/mkamsboot/dualboot/dualboot.S21
1 files changed, 21 insertions, 0 deletions
diff --git a/rbutil/mkamsboot/dualboot/dualboot.S b/rbutil/mkamsboot/dualboot/dualboot.S
index 4df69a45cc..fae13df0e9 100644
--- a/rbutil/mkamsboot/dualboot/dualboot.S
+++ b/rbutil/mkamsboot/dualboot/dualboot.S
@@ -182,6 +182,27 @@ uclcopy:
cmp r1, #0 @ test input from pins
bne boot_of @ branch directly to OF if either pin high
+ ldr r0, =GPIOC
+
+ ldr r1, [r0, #0x400]
+ orr r1, r1, #((1<<1)|(1<<2)) @ output
+ bic r1, r1, #(1<<5) @ input
+ str r1, [r0, #0x400]
+
+ mov r1, #0
+ str r1, [r0, #4*(1<<1)] @ zero C1
+ mov r1, #(1<<2)
+ str r1, [r0, #4*(1<<2)] @ set C2
+
+ mov r1, #50 /* small delay */
+1: subs r1, r1, #1
+ bne 1b
+
+ ldr r1, [r0, #4*(1<<5)] @ read C5 = left
+
+ cmp r1, #0
+ bne boot_of
+
#elif defined(SANSA_C200V2)
.set BUTTON_LEFT, (1<< 2)
.set BUTTON_DOWN, (1<< 3)