aboutsummaryrefslogtreecommitdiff
path: root/pll.s
diff options
context:
space:
mode:
authorJacques Comeaux <jacquesrcomeaux@protonmail.com>2023-12-24 23:03:47 -0600
committerJacques Comeaux <jacquesrcomeaux@protonmail.com>2023-12-24 23:03:47 -0600
commitad75550260068087c4351a6a197e10c02fe3b399 (patch)
treeb9d6504843caa03b7aa0e0823672104ec57bfd79 /pll.s
parent8c8569bf9575a4f1077a1b8a61f47d5b4ff55727 (diff)
Add blinkN subroutine
Diffstat (limited to 'pll.s')
-rw-r--r--pll.s10
1 files changed, 10 insertions, 0 deletions
diff --git a/pll.s b/pll.s
index 7458f61..38573f7 100644
--- a/pll.s
+++ b/pll.s
@@ -56,3 +56,13 @@ vco_lock:
movs r0, 0x8 // postdiv (bit 3)
str r0, [r1, PWR_OFST]
bx lr
+
+.type delay_1s, %function
+.global delay_1s
+
+delay_1s:
+ ldr r3, =0x1fca055 // 33.3 * 10^6 (one-third of a second at 100MHz)
+1: // 3 clock cycle loop
+ subs r3, r3, 1 // 1 clock cycle
+ bne 1b // 2 clock cycles when taken
+ mov pc, lr