summaryrefslogtreecommitdiff
path: root/software/first/delay.S
diff options
context:
space:
mode:
Diffstat (limited to 'software/first/delay.S')
-rw-r--r--software/first/delay.S6
1 files changed, 2 insertions, 4 deletions
diff --git a/software/first/delay.S b/software/first/delay.S
index 4df998a..656625f 100644
--- a/software/first/delay.S
+++ b/software/first/delay.S
@@ -16,10 +16,8 @@ delay:
li t2, MTIME_FREQUENCY # get clock freq (approx.)
mul t2, t2, a0 # multiply milliseconds with freq
add t2, t1, t2 # target mtime is now in t2
-
-1:
- lw t1, 0(t0) # load value of the timer
- blt t1, t2, 1b # keep looping until target mtime has been reached
+ li t3, MTIMECMP # load address of MTIMECMP register
+ sw t2, 0(t3) # store target time to MTIMECMP register. This only stores 32 bits so I am not sure if that is correct...
lw ra, 12(sp) # load return address
addi sp, sp, 16 # deallocate stack frame