summaryrefslogtreecommitdiff
path: root/software
diff options
context:
space:
mode:
authorSilvan Jegen <s.jegen@gmail.com>2019-07-23 21:53:33 +0200
committerSilvan Jegen <s.jegen@gmail.com>2019-07-23 21:53:33 +0200
commit3f8b15773b76750d0e877fac502277e2d5dcf791 (patch)
tree2fb739029f79e61116c74b9363f6d47269192e07 /software
parentf5e284223d25ee5beab98de95cd74e3ac72a39a6 (diff)
first: fix tabs vs. spaces
Diffstat (limited to 'software')
-rw-r--r--software/first/delay.S8
-rw-r--r--software/first/first.c2
-rw-r--r--software/first/set_LED.S18
-rw-r--r--software/first/setup_gpio.S4
4 files changed, 15 insertions, 17 deletions
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