Skip to content

Commit 6f99393

Browse files
committed
Added mostly reliable delay system
1 parent d20db11 commit 6f99393

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

kernel7.asm

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@ MainLoop:
6565
bl DrawPlayer
6666
pop {r0-r9}
6767

68+
add r4,#10
69+
add r5,#10
70+
71+
push {r0-r9}
72+
mov r1, $FF000
73+
bl TIMER
74+
pop {r0-r9}
75+
6876
b MainLoop ;loop forever
6977

7078
CoreLoop: ; Infinite Loop For Core 1..3

timer2_2Param.asm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
TIMER: ;this function has 2 parameters
1+
TIMER: ;this function has 1 parameter
22
TIMER_OFFSET=$3000
3-
mov r3,r0 ;BASE - depends on Pi model
3+
mov r3,BASE
44
orr r3,TIMER_OFFSET
55
mov r4,r1 ;$80000 passed as a parameter
66
ldrd r6,r7,[r3,#4]
77
mov r5,r6
88
loopt1: ;label still has to be different from one in _start
99
ldrd r6,r7,[r3,#4]
10-
sub r8,r6,r5
10+
sub r8,r6,r5
1111
cmp r8,r4
1212
bls loopt1
1313
bx lr ;return

0 commit comments

Comments
 (0)