From aaa20f3c37209a5ad0a45c09f840ecb0727318a2 Mon Sep 17 00:00:00 2001 From: Silvan Jegen Date: Sat, 31 Aug 2019 19:33:00 +0200 Subject: software/first: remove unused delay.S file --- software/first/delay.S | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 software/first/delay.S (limited to 'software') diff --git a/software/first/delay.S b/software/first/delay.S deleted file mode 100644 index 039d924..0000000 --- a/software/first/delay.S +++ /dev/null @@ -1,26 +0,0 @@ -.section .text -.align 2 -.global delay -.include "memory_map.inc" - - -# a0 is delay-in-milliseconds argument - -delay: - addi sp, sp, -16 # Allocate stack frame - sw ra, 12(sp) # save return address to the stack - - li t0, MTIME # load the timer register - lw t1, 0(t0) # load low value of the timer - lw t2, 4(t0) # load high value of the timer - - li t3, MTIME_FREQUENCY # get clock freq (approx.) - mul t3, t3, a0 # multiply milliseconds with freq - add t4, t1, t3 # target mtime is now in t4 - li t0, MTIMECMP # load address of MTIMECMP register - sw t2, 4(t0) # set higher 32bits of MTIMECMP - sw t4, 0(t0) # 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 - ret -- cgit v1.2.3