changed blink pattern in example program

master
Ondřej Hruška 9 years ago
parent 6f66ee975d
commit bb797d4297
  1. 27
      main.asm

@ -85,22 +85,25 @@ SysTick_Handler
__main __main
EXPORT __main ; Export the address to startup script EXPORT __main ; Export the address to startup script
ENTRY ; Marks the program entry point (shouldnt be here) ENTRY ; Marks the program entry point (shouldnt be here)
LOOP
; blink the other led slowly
; (using bit-banding)
LDR R0, =BB_GPIOC_ODR_8 LOOP ; Main loop
LDR R1, [R0] ; turn LED on
EOR R1, R1, #1 LDR R0, =BB_GPIOC_ODR_8 ; bit-banding address
MOV R1, #1
STR R1, [R0] STR R1, [R0]
; (writing the entire register) - can cause race condition with SysTick interrupt ; wait
; LDR R0, =GPIOC_ODR MOV R0, #40
; LDR R1, [R0] BL DELAY
; EOR R1, R1, #GPIO8
; STR R1, [R0] ; turn LED off
LDR R0, =BB_GPIOC_ODR_8
MOV R1, #0
STR R1, [R0]
MOV R0, #50 ; wait
MOV R0, #10
BL DELAY BL DELAY
B LOOP B LOOP

Loading…
Cancel
Save