commit 572d9cc55ca9cce6aa24440c73a72a18d46b9bfe
parent 31b8a0f3c01e559312118174e8e75b00148de40b
Author: Matsuda Kenji <info@mtkn.jp>
Date: Mon, 26 Feb 2024 17:24:10 +0900
enable interrupt again
Diffstat:
1 file changed, 8 insertions(+), 10 deletions(-)
diff --git a/ex3/main.s b/ex3/main.s
@@ -100,16 +100,14 @@ wait_vco:
// enable FIFO and set format
ldr r0, =(3 << 5 | 1 << 4) // WLEN = 8, FEN = 1
str r0, [r3, #0x2c] // UART: UARTLCR_H
-/*
+
// enable interrupt
ldr r3, ppb_base
// enable timer_irq_0
ldr r1, =0xe100
mov r0, #1
str r0, [r3, r1] // M0PLUS: NVIC_ISER
-*/
-loop:
// setup timer
ldr r3, timer_base
// enable alarm_0 interrupt
@@ -119,19 +117,19 @@ loop:
ldr r0, =0x20000 //
bl set_alarm
-wait:
- ldr r0, [r3, #0x20] // TIMER: ARMED
- mov r1, #0x1
- tst r0, r1
- bne wait
+ // debug
+ ldr r3, clocks_base
+ ldr r0, [r3, #0x54] // CLOCK: CLK_USB_CTRL
+ bl printh
- mov r3, #0
- ldr r0, [r3, #0x4]
+loop:
+ ldr r0, =0xdeadcafe
bl printh
mov r0, #'\r'
bl putbyte
mov r0, #'\n'
bl putbyte
+ wfi
b loop
// functions