bit of code cleanup before submission

This commit is contained in:
Trevor Barnes
2019-10-08 19:02:13 -05:00
parent cbe00ffd95
commit d038cd8ee3
8 changed files with 1918 additions and 1912 deletions

View File

@@ -2131,3 +2131,39 @@ arm-none-eabi-size "lab3subroutines.elf"
text data bss dec hex filename
1420 1080 1092 3592 e08 lab3subroutines.elf
18:57:54 **** Incremental Build of configuration Debug for project lab3subroutines ****
make all
Building file: ../src/led.s
Invoking: MCU GCC Assembler
C:\Users\barnestr\Documents\CE2801\workspace\lab3subroutines\Debug
arm-none-eabi-as -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -g -o "src/led.o" "../src/led.s"
Finished building: ../src/led.s
Building file: ../src/main.s
Invoking: MCU GCC Assembler
C:\Users\barnestr\Documents\CE2801\workspace\lab3subroutines\Debug
arm-none-eabi-as -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -g -o "src/main.o" "../src/main.s"
Finished building: ../src/main.s
Building target: lab3subroutines.elf
Invoking: MCU GCC Linker
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -T"C:\Users\barnestr\Documents\CE2801\workspace\lab3subroutines\LinkerScript.ld" -Wl,-Map=output.map -Wl,--gc-sections -o "lab3subroutines.elf" @"objects.list" -lm
Finished building target: lab3subroutines.elf
make --no-print-directory post-build
Generating binary and Printing size information:
arm-none-eabi-objcopy -O binary "lab3subroutines.elf" "lab3subroutines.bin"
arm-none-eabi-size "lab3subroutines.elf"
text data bss dec hex filename
1372 1080 1092 3544 dd8 lab3subroutines.elf
18:59:11 **** Incremental Build of configuration Debug for project lab3subroutines ****
make all
Building file: ../src/main.s
Invoking: MCU GCC Assembler
C:\Users\barnestr\Documents\CE2801\workspace\lab3subroutines\Debug
arm-none-eabi-as -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -g -o "src/main.o" "../src/main.s"
../src/main.s: Assembler messages:
../src/main.s:63: Error: invalid constant (270f) after fixup
src/subdir.mk:21: recipe for target 'src/main.o' failed
make: *** [src/main.o] Error 1

File diff suppressed because it is too large Load Diff

View File

@@ -60,35 +60,6 @@ num_to_LED_init:
# Branch back to link location
bx lr
.global LED_test_loop
LED_test_loop:
push {r0,r1,r2,lr}
bl num_to_LED_init
ldr r1, =GPIOB_BASE
loop:
ldr r2,[r1,#GPIO_ODR]
orr r2,r2,#0x0020
str r2,[r1,#GPIO_ODR]
mov r0, #0x3E8
bl delay_ms
ldr r2,[r1,#GPIO_ODR]
bic r2,r2,#0x0020
str r2,[r1,#GPIO_ODR]
mov r0, #0x3E8
bl delay_ms
b loop
pop {r0,r1,r2,pc}
.global num_to_LED
# Takes in a 10-bit value and displays it on the LEDs in binary
# Input:

View File

@@ -2,7 +2,9 @@
# Trevor Barnes
# CE2801-031
# Lab 3: Subroutines
# Description:
# Description: The driver for Lab 3. Displays the binary ASCII
# value of the hardcoded number "1234", one character
# at a time every half second.
.syntax unified
.cpu cortex-m4
@@ -21,7 +23,7 @@ main_loop:
mov r0, #1234
bl num_to_ASCII
mov r1, r0
# r1 is 4 character ASCII value
# r1 is a 4 character ASCII value
mov r0, #500
# Display 1
ubfx r0, r1, #24, #8
@@ -45,11 +47,7 @@ main_loop:
bl delay_ms
b main_loop
end:
b end
.global num_to_ASCII
# Takes in a value from 0-9999 and converts it to ASCII
# Input:
# r0: Input binary value
@@ -62,10 +60,10 @@ num_to_ASCII:
cmp r0,#0
blt out_of_range
@ cmp r0,#9999
@ bgt out_of_range
cmp r0,#9999
bgt out_of_range
# Normal conversion behavior
# Normal conversion behavior
mov r1, #16
lsl r0, #3
sub r1, #3
@@ -106,7 +104,6 @@ end_verify_nibbles:
bne shift_cycle
mov r3, #3
# Encode BCD numbers to ASCII
# Extract ones nibble
ubfx r2, r0, #16, #4
# Insert ones nibble
@@ -142,6 +139,7 @@ out_of_range:
movt r1, #0x4572
end_ASCII:
# Return value in r0
mov r0, r1
pop {r1,r2,r3,lr}
bx lr