From 9169796632fcdeb5e8e74ed60c6cbe31081e51f2 Mon Sep 17 00:00:00 2001 From: Christian Cunningham Date: Thu, 24 Feb 2022 23:38:38 -0700 Subject: MMU and working on hardware --- src/cpu/irq.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'src/cpu') diff --git a/src/cpu/irq.c b/src/cpu/irq.c index 125c3a6..cfa9d7d 100644 --- a/src/cpu/irq.c +++ b/src/cpu/irq.c @@ -5,11 +5,13 @@ #include #include #include -#include #include #include +#include #include +#define CPS 1000 + void handle_data(unsigned char); void c_irq_handler(void) @@ -59,7 +61,7 @@ void c_irq_handler(void) } // Add task to handle the data else { - add_thread(handle_data, (void*)data, 1); + //add_thread(handle_data, (void*)data, 1); } return; } @@ -75,7 +77,6 @@ void c_irq_handler(void) } // Check if CNTV triggered the interrupt else if (source & (1 << 3)) { - c_timer(); return; } return; @@ -87,14 +88,15 @@ unsigned long c_fiq_handler(void) unsigned long source = load32(CORE0_FIQ_SOURCE); // Check if CNTV triggered the interrupt if (source & (1 << 3)) { - c_timer(); + // Reset the counter + write_cntv_tval(cntfrq/CPS); counter++; - if (counter % 0x6000 == 0) { + if (counter % 0x6000 == 0) counter = 0; - } - if (counter % 0x30 == 0) { + if (counter % 0x10 == 0) + status(); + if (counter % 0x40 == 0) return 1; - } return 0; } return 0; -- cgit v1.2.1