Make timer target value configurable

This commit is contained in:
2022-11-06 20:11:01 +01:00
parent c35376833f
commit 85112d9938
3 changed files with 24 additions and 8 deletions

View File

@@ -21,7 +21,7 @@ timer_status_addr: .word 0x000F000C
dmem_start_addr: .word 0x00000400
dmem_end_addr: .word 0x000004FC
priority_mask: .word 0xFFFFFF03
xor_mask: .word 0xFFFFFFFF
timer_target_value: .word 127 // change for simulation / real board
main:
// Initialize stack pointer to the end of the data memory
@@ -33,6 +33,7 @@ main:
ldr r0,>led_addr // LED addr
ldr r1,>timer_status_addr // Timer addr
ldr r3,>timer_counter_addr // Timer addr
// Init
clr r9 // 0 if we are currently filling, 1 if we are currently flushing
@@ -42,6 +43,9 @@ main:
addi r4, 10
// Enable the timer...
ldr r2, >timer_target_value // target value
st32 r3, r2
clr r2
addi r2, 0x3 // enable and repeat bit set
st32 r1, r2