aboutsummaryrefslogtreecommitdiff
path: root/src/cpu
diff options
context:
space:
mode:
authorChristian Cunningham <cc@localhost>2022-03-22 16:37:56 -0700
committerChristian Cunningham <cc@localhost>2022-03-22 16:37:56 -0700
commit798e73e7142f02a2cf7261a37095a84db47d877b (patch)
tree4f34d28e7d486face6b054e0cf50f77fd849b2a1 /src/cpu
parent2612bc83c57d3bc36d6042db14d898324c0091ff (diff)
More debug information
Diffstat (limited to 'src/cpu')
-rw-r--r--src/cpu/irq.c38
1 files changed, 20 insertions, 18 deletions
diff --git a/src/cpu/irq.c b/src/cpu/irq.c
index d4c157f..e3353e8 100644
--- a/src/cpu/irq.c
+++ b/src/cpu/irq.c
@@ -26,29 +26,27 @@ unsigned long c_irq_handler(void)
if(load32(UART0_MIS) & (1<<4)) {
// Get the UART data
unsigned long data = load32(UART0_DR);
- // Draw it on the screen
- {
- draw_chex32(0, 9, data, 0xAA00FF);
- }
// Handle the recieved data
// Ctrl+G to output scheduler debug info
- if (data == 0x7)
+ if (data == 0x7) {
uart_scheduler();
- // Ctrl+T to toggle timer
- else if(data == 0x14) {
- unsigned long timer_status;
- asm volatile("mrc p15, 0, %0, c14, c3, 1" : "=r"(timer_status));
- if(timer_status == 0) {
- cntfrq = read_cntfrq();
- write_cntv_tval(cntfrq/CPS);
- enablecntv();
- draw_cstring(0, 3, "TIMER", 0x00FF00);
- } else {
- disablecntv();
- draw_cstring(0, 3, "TIMER", 0xFF0000);
- }
+ uart_mutexes();
}
+ //// Ctrl+T to toggle timer
+ //else if(data == 0x14) {
+ // unsigned long timer_status;
+ // asm volatile("mrc p15, 0, %0, c14, c3, 1" : "=r"(timer_status));
+ // if(timer_status == 0) {
+ // cntfrq = read_cntfrq();
+ // write_cntv_tval(cntfrq/CPS);
+ // enablecntv();
+ // draw_cstring(0, 3, "TIMER", 0x00FF00);
+ // } else {
+ // disablecntv();
+ // draw_cstring(0, 3, "TIMER", 0xFF0000);
+ // }
+ //}
// Add task to handle the data
else {
add_thread(handle_data, (void*)data, 7);
@@ -111,4 +109,8 @@ void handle_data(unsigned char data)
} else if (data == 0x62) {
//add_thread(test_entry, 0, 2);
}
+ // Draw it on the screen
+ {
+ draw_chex32(0, 9, data, 0xAA00FF);
+ }
}