From 3f8b15773b76750d0e877fac502277e2d5dcf791 Mon Sep 17 00:00:00 2001 From: Silvan Jegen Date: Tue, 23 Jul 2019 21:53:33 +0200 Subject: first: fix tabs vs. spaces --- software/first/delay.S | 8 ++++---- software/first/first.c | 2 -- software/first/set_LED.S | 18 +++++++++--------- software/first/setup_gpio.S | 4 ++-- 4 files changed, 15 insertions(+), 17 deletions(-) (limited to 'software') diff --git a/software/first/delay.S b/software/first/delay.S index cb49ba1..4df998a 100644 --- a/software/first/delay.S +++ b/software/first/delay.S @@ -15,12 +15,12 @@ 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 + add t2, t1, t2 # target mtime is now in t2 1: - lw t1, 0(t0) # load value of the timer + lw t1, 0(t0) # load value of the timer blt t1, t2, 1b # keep looping until target mtime has been reached - lw ra, 12(sp) # load return address - addi sp, sp, 16 # deallocate stack frame + lw ra, 12(sp) # load return address + addi sp, sp, 16 # deallocate stack frame ret diff --git a/software/first/first.c b/software/first/first.c index ed6e91b..ede96db 100644 --- a/software/first/first.c +++ b/software/first/first.c @@ -5,8 +5,6 @@ #include "super_blink.h" int main() { - printf("Hello, cute waffle!\n"); - int error = 0; int ledNum = 0; int colours[NUM_LEDS] = { diff --git a/software/first/set_LED.S b/software/first/set_LED.S index e436615..0785d43 100644 --- a/software/first/set_LED.S +++ b/software/first/set_LED.S @@ -23,24 +23,24 @@ set_LED: beq a1, t2, ledOn # branch if on requested li a0, ERROR # bad status request, return error - j exit + j exit ledOn: - or t1, t1, a0 # only change the value of the requested LED (xor in the video) - sw t1, GPIO_OUTPUT_VAL(t0) # write new LED values to the right address + or t1, t1, a0 # only change the value of the requested LED (xor in the video) + sw t1, GPIO_OUTPUT_VAL(t0) # write new LED values to the right address li a0, NOERROR # success - j exit + j exit ledOff: - xor a0, a0, 0xffffffff # invert bits so off bits are off - and t1, t1, a0 # turn of LEDs - sw t1, GPIO_OUTPUT_VAL(t0) # write new LED values to the right address + xor a0, a0, 0xffffffff # invert bits so off bits are off + and t1, t1, a0 # turn of LEDs + sw t1, GPIO_OUTPUT_VAL(t0) # write new LED values to the right address li a0, NOERROR # success exit: - lw ra, 12(sp) # load return address - addi sp, sp, 16 # deallocate stack frame + lw ra, 12(sp) # load return address + addi sp, sp, 16 # deallocate stack frame ret diff --git a/software/first/setup_gpio.S b/software/first/setup_gpio.S index 39003b4..d2f4186 100644 --- a/software/first/setup_gpio.S +++ b/software/first/setup_gpio.S @@ -14,6 +14,6 @@ setup_GPIO: sw t1, GPIO_OUTPUT_XOR(t0) # set the RGB pins to active high sw x0, GPIO_OUTPUT_VAL(t0) # set all pins to 0 - lw ra, 12(sp) # load return address - addi sp, sp, 16 # deallocate stack frame + lw ra, 12(sp) # load return address + addi sp, sp, 16 # deallocate stack frame ret -- cgit v1.2.3