From bb797d42972fead3a9be5b0e8a8c4d42443e54ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Tue, 20 Oct 2015 10:11:45 +0200 Subject: [PATCH] changed blink pattern in example program --- main.asm | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/main.asm b/main.asm index 10fc9a5..904b1d5 100644 --- a/main.asm +++ b/main.asm @@ -85,22 +85,25 @@ SysTick_Handler __main EXPORT __main ; Export the address to startup script ENTRY ; Marks the program entry point (shouldnt be here) -LOOP - ; blink the other led slowly - ; (using bit-banding) - LDR R0, =BB_GPIOC_ODR_8 - LDR R1, [R0] - EOR R1, R1, #1 + +LOOP ; Main loop + ; turn LED on + LDR R0, =BB_GPIOC_ODR_8 ; bit-banding address + MOV R1, #1 STR R1, [R0] - ; (writing the entire register) - can cause race condition with SysTick interrupt -; LDR R0, =GPIOC_ODR -; LDR R1, [R0] -; EOR R1, R1, #GPIO8 -; STR R1, [R0] + ; wait + MOV R0, #40 + BL DELAY + + ; turn LED off + LDR R0, =BB_GPIOC_ODR_8 + MOV R1, #0 + STR R1, [R0] - MOV R0, #50 + ; wait + MOV R0, #10 BL DELAY B LOOP