X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=rpikern;a=blobdiff_plain;f=src%2Fstartup.s;fp=src%2Fstartup.s;h=d0b402f24a24ea29b366d8072956c0049355fb5a;hp=30e2a6676a7b12c327dc184f7a19a703b1546310;hb=311d50a18e3cdc236781882198671b4e1a538535;hpb=23900e0baeb014e7e0b7e8e55942771da1523050 diff --git a/src/startup.s b/src/startup.s index 30e2a66..d0b402f 100644 --- a/src/startup.s +++ b/src/startup.s @@ -3,9 +3,10 @@ .section .startup .code 32 +startup: ldr sp, =_stacktop - mov r0, #1 + mov r0, #2 bl dbgled @ clear bss @@ -23,18 +24,21 @@ mov r0, #0 bl dbgled -halt: wfe - b halt + .global exit +exit: wfe + b exit + .global dbgled dbgled: ldr r3, =0x3f200000 @ gpio base ldr r2, =0x9000 @ gpio 24 and 25 -> output str r2, [r3, #8] @ store to GPFSEL2 ldr r2, =0x01000000 @ bit 24 - teq r0, #0 - streq r2, [r3, #0x1c] @ GPSET0 - strne r2, [r3, #0x28] @ GPCLR0 + tst r0, #1 + strne r2, [r3, #0x1c] @ GPSET0 + streq r2, [r3, #0x28] @ GPCLR0 lsl r2, #1 + tst r0, #2 strne r2, [r3, #0x1c] @ GPSET0 streq r2, [r3, #0x28] @ GPCLR0 bx lr