aboutsummaryrefslogtreecommitdiff
path: root/src/cpu
diff options
context:
space:
mode:
authorChristian Cunningham <cc@localhost>2022-03-02 15:36:24 -0700
committerChristian Cunningham <cc@localhost>2022-03-02 15:36:24 -0700
commit4c74418b1d97b2e9f7daeea365d5018db199fca7 (patch)
treecf3c2672343c6dd75e316003d2cf4242a30c3d40 /src/cpu
parentc31227d9046c3ab853255f89358966fe0721e957 (diff)
Ensure one test is added
Mount and export make
Diffstat (limited to 'src/cpu')
-rw-r--r--src/cpu/irq.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/cpu/irq.c b/src/cpu/irq.c
index 9e44009..e2a6773 100644
--- a/src/cpu/irq.c
+++ b/src/cpu/irq.c
@@ -55,12 +55,18 @@ void c_irq_handler(void)
}
}
// Check if System Time Compare 0 Triggered the Interrupt
- else if (*(unsigned long*)SYS_TIMER_CS == SYS_TIMER_SC_M0) {
- volatile unsigned long* timer_cs = (unsigned long*)SYS_TIMER_CS;
- volatile unsigned long* timer_chi = (unsigned long*)SYS_TIMER_CHI;
- volatile unsigned long* nexttime = (unsigned long*)SYS_TIMER_C0;
+ else if (*(volatile unsigned long*)SYS_TIMER_CS & SYS_TIMER_SC_M0) {
+ volatile unsigned long* timer_cs = (volatile unsigned long*)SYS_TIMER_CS;
+ volatile unsigned long* timer_chi = (volatile unsigned long*)SYS_TIMER_CHI;
+ volatile unsigned long* nexttime = (volatile unsigned long*)SYS_TIMER_C0;
+ static char timer_lock = 0;
+ if (!timer_lock) {
+ timer_lock = 1;
+ add_thread(test_entry, 0, 2);
+ timer_lock = 0;
+ }
+ *nexttime = *timer_chi + 30000000;
*timer_cs = SYS_TIMER_SC_M0;
- *nexttime = *timer_chi + 60000000;
}
}
// Check if CNTV triggered the interrupt