diff options
author | Christian Cunningham <cc@localhost> | 2021-12-23 07:32:54 -0800 |
---|---|---|
committer | Christian Cunningham <cc@localhost> | 2021-12-23 07:32:54 -0800 |
commit | 9130122609599f14f30fd6d2b32d15865cc8dfe3 (patch) | |
tree | 6d099a03f9be4028b234c1d06cafd92446d629ea /src/cpu | |
parent | 5427e73f6437edd0c889a107ebb6adb4436d55da (diff) |
Moving away from UART output
Diffstat (limited to 'src/cpu')
-rw-r--r-- | src/cpu/irq.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/src/cpu/irq.c b/src/cpu/irq.c index 1d50c7d..7c7fc45 100644 --- a/src/cpu/irq.c +++ b/src/cpu/irq.c @@ -1,7 +1,8 @@ #include "../cpu/irq.h" +#include "../drivers/uart.h" +#include "../graphics/drawer.h" #include "../sys/core.h" #include "../sys/timer.h" -#include "../drivers/uart.h" #include "../util/mutex.h" #include "../util/time.h" @@ -22,23 +23,22 @@ void c_irq_handler(void) { if(data == 0x14) { unsigned long timer_status; asm volatile("mrc p15, 0, %0, c14, c3, 1" : "=r"(timer_status)); + unsigned int x = g_Drawer.x; + unsigned int y = g_Drawer.y; + g_Drawer.x = 0; + g_Drawer.y = 7; + write_string(&g_Drawer, "TIMER: "); if(timer_status == 0) { cntfrq = read_cntfrq(); write_cntv_tval(cntfrq); enable_cntv(); -#ifndef NOANSI - uart_string((char*)"\033[?25l\033[s\033[4;1H\033[0KTimer: \033[92mEnabled\033[0m\033[u\033[?25h"); -#else - uart_string((char*)"\033[?25l\033[4;1H\033[0KTimer: \033[92mEnabled\033[0m\033[8;1H\033[?25h> "); -#endif + write_cstring(&g_Drawer, "Enabled ", 0x00FF00); } else { disable_cntv(); -#ifndef NOANSI - uart_string((char*)"\033[?25l\033[s\033[4;1H\033[0KTimer: \033[91mDisabled\033[0m\033[u\033[?25h"); -#else - uart_string((char*)"\033[?25l\033[4;1H\033[0KTimer: \033[91mDisabled\033[0m\033[8;1H\033[?25h> "); -#endif + write_cstring(&g_Drawer, "Disabled", 0xFF0000); } + g_Drawer.x = x; + g_Drawer.y = y; } else { unsigned long off = cmdidx; if (off < 2048) { @@ -46,7 +46,6 @@ void c_irq_handler(void) { if (data == 0x0D) { off = 0; cmd[0] = 0x0; - //uart_char(0x0a); uart_char(data); uart_string("\033[?25l> \033[0K\033[?25h"); // Backspace Case |