aboutsummaryrefslogtreecommitdiff
path: root/src/cpu
diff options
context:
space:
mode:
authorChristian Cunningham <cc@localhost>2022-01-20 23:22:42 -0700
committerChristian Cunningham <cc@localhost>2022-01-20 23:22:42 -0700
commit73a80de4228a498b483c8e10ab317920d978d507 (patch)
treeeea73a138a509d7758ef477d4997cf7147233604 /src/cpu
parentc2e52566ed53b53227a6fe577a05170766a1ae4c (diff)
Moved globals to file
Diffstat (limited to 'src/cpu')
-rw-r--r--src/cpu/irq.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/cpu/irq.c b/src/cpu/irq.c
index fb73b8a..c966935 100644
--- a/src/cpu/irq.c
+++ b/src/cpu/irq.c
@@ -1,9 +1,9 @@
#include <cpu/irq.h>
#include <drivers/uart.h>
+#include <globals.h>
#include <graphics/drawer.h>
#include <symbols.h>
#include <sys/core.h>
-#include <sys/kernel.h>
#include <sys/schedule.h>
#include <sys/timer.h>
#include <util/mutex.h>
@@ -67,7 +67,7 @@ void c_irq_handler(void)
} else if (data == 0x61) {
cmd[off] = (char) data;
off += 1;
- //_start(); // Trigger reset
+ _start(); // Trigger reset
//heap_info_u();
// Else output
} else {
@@ -98,12 +98,18 @@ void c_irq_handler(void)
write_string(&g_Drawer, cmd);
return;
}
+ } 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;
+ *timer_cs = SYS_TIMER_SC_M0;
+ *nexttime = *timer_chi + 60000000;
+ } else {
+ uart_string("Pending?");
}
} else if (source & (1 << 3)) {
c_timer();
return;
- } else {
- uart_string("Unknown Interrupt Detected!");
}
return;
}
@@ -194,12 +200,17 @@ void c_fiq_handler(void)
write_string(&g_Drawer, cmd);
return;
}
+ } 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;
+ *timer_cs = SYS_TIMER_SC_M0;
+ //*nexttime = *timer_chi + 60000000;
+ *nexttime = *timer_chi + 10000;
}
} else if (source & (1 << 3)) {
c_timer();
return;
- } else {
- uart_string("Unknown Interrupt Detected!");
}
return;
}