diff options
author | Jacques Comeaux <jacquesrcomeaux@protonmail.com> | 2024-01-08 02:03:28 -0600 |
---|---|---|
committer | Jacques Comeaux <jacquesrcomeaux@protonmail.com> | 2024-01-08 02:03:28 -0600 |
commit | 3fea4bbdea86287b07515dbb794d2fd03518a0f8 (patch) | |
tree | 139b65b75c684a6849c8e8becf1006ed628dc440 | |
parent | c6ddfc67dd16bd197580fbead9f454031384cc5a (diff) |
Add led_on subroutine
-rw-r--r-- | blink.s | 14 | ||||
-rw-r--r-- | main.s | 5 |
2 files changed, 14 insertions, 5 deletions
@@ -7,8 +7,9 @@ .equ GPIO25_CTRL, (IO_BANK0_BASE + 0x0cc) .equ SIO_BASE, 0xd0000000 -.equ GPIO_OE_SET_OFST, 0x024 +.equ GPIO_OUT_SET_OFST, 0x014 .equ GPIO_OUT_XOR_OFST, 0x01c +.equ GPIO_OE_SET_OFST, 0x024 .equ ATOMIC_CLEAR, 0x3000 @@ -25,6 +26,17 @@ setup_led: str r0, [r1, GPIO_OE_SET_OFST] bx lr +.type led_on, %function +.global led_on + +led_on: + ldr r1, =SIO_BASE + movs r0, 1 + lsls r0, 25 + str r0, [r1, GPIO_OUT_SET_OFST] +1: + b 1b + .type blink, %function .global blink @@ -11,7 +11,4 @@ main: bl setup_clocks bl setup_gpio bl setup_led - movs r0, 3 - bl blinkN -stop: - b stop + b led_on |