From 73a80de4228a498b483c8e10ab317920d978d507 Mon Sep 17 00:00:00 2001 From: Christian Cunningham Date: Thu, 20 Jan 2022 23:22:42 -0700 Subject: Moved globals to file --- src/cpu/irq.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'src/cpu') 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 #include +#include #include #include #include -#include #include #include #include @@ -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; } -- cgit v1.2.1