From 1b4c8e04ded44fa11a1e95d2db5bef4b8eaddcd1 Mon Sep 17 00:00:00 2001 From: Christian Cunningham Date: Mon, 31 Jan 2022 19:34:03 -0700 Subject: Remove old global --- include/globals.h | 2 -- src/cpu/irq.c | 41 +++++++++++++++++------------------------ src/globals.S | 6 ------ src/sys/core.c | 3 +-- 4 files changed, 18 insertions(+), 34 deletions(-) diff --git a/include/globals.h b/include/globals.h index cf37c06..2d1f7a4 100644 --- a/include/globals.h +++ b/include/globals.h @@ -6,8 +6,6 @@ #ifndef GLOBALS_C extern unsigned long irqlr; extern unsigned long cntfrq; -extern unsigned long cmdidx; -extern char cmd[2048]; extern char* os_name; extern char* os_info_v; diff --git a/src/cpu/irq.c b/src/cpu/irq.c index 7f2a89e..24a809c 100644 --- a/src/cpu/irq.c +++ b/src/cpu/irq.c @@ -93,30 +93,24 @@ unsigned long c_fiq_handler(void) void handle_data(unsigned char data) { - unsigned long off = cmdidx; - if (off < 2048) { - // Newline Case - if (data == 0x0D) { - // Backspace Case - } else if (data == 0x08 || data == 0x7F) { - // Lock Case - } else if (data == 0x6C) { - lock_mutex(&exe_cnt_m, SYS_PID); - // Release Case - } else if (data == 0x72) { - release_mutex(&exe_cnt_m, SYS_PID); - } else if (data == 0x61) { - add_thread(testfxn, 0, 3); - } else if (data == 0x62) { - add_thread(uart_scheduler, 0, 2); - } else if (data == 0x63) { - add_thread(heap_info, 0, 2); - // Else output - } else { - } - } else if (off == 2048) { + // Newline Case + if (data == 0x0D) { + // Backspace Case + } else if (data == 0x08 || data == 0x7F) { + // Lock Case + } else if (data == 0x6C) { + lock_mutex(&exe_cnt_m, SYS_PID); + // Release Case + } else if (data == 0x72) { + release_mutex(&exe_cnt_m, SYS_PID); + } else if (data == 0x61) { + add_thread(testfxn, 0, 3); + } else if (data == 0x62) { + add_thread(uart_scheduler, 0, 2); + } else if (data == 0x63) { + add_thread(heap_info, 0, 2); + } else { } - cmdidx = off; g_Drawer.x = 0; g_Drawer.y = 7; for(int i = 0; i < 128; i++) @@ -124,7 +118,6 @@ void handle_data(unsigned char data) g_Drawer.x = 0; g_Drawer.y = 7; write_string(&g_Drawer, "> "); - write_string(&g_Drawer, cmd); } void testfxn2(void) diff --git a/src/globals.S b/src/globals.S index f6ec57f..b808053 100644 --- a/src/globals.S +++ b/src/globals.S @@ -5,9 +5,3 @@ irqlr: .globl cntfrq cntfrq: .word 0 -.globl cmdidx -cmdidx: - .word 0 -.global cmd -cmd: - .space 2049 diff --git a/src/sys/core.c b/src/sys/core.c index 39eaffd..1b71d3d 100644 --- a/src/sys/core.c +++ b/src/sys/core.c @@ -4,7 +4,6 @@ #include #include #include -#include #include #include #include @@ -22,7 +21,7 @@ void __attribute__((naked)) usr_schedule(void); // Initialize IRQs void sysinit(void) { - // Clear System Globals + // Initialize System Globals exe_cnt_m.addr = &exe_cnt; exe_cnt_m.pid = NULL_PID; rpi_heap_top = &rpi_heap; -- cgit v1.2.1