diff options
author | Christian Cunningham <cc@localhost> | 2022-01-23 17:25:24 -0700 |
---|---|---|
committer | Christian Cunningham <cc@localhost> | 2022-01-23 17:25:24 -0700 |
commit | baddd8e56401dea4371028b4829ae71a587c2305 (patch) | |
tree | 250513b1ba4a76e7bc7ad04eecb01d239a041478 /src/cpu | |
parent | 92a8ff59a2f23edda9df24f1f019ab1a6c11f0dd (diff) |
Added test functions
Diffstat (limited to 'src/cpu')
-rw-r--r-- | src/cpu/irq.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/cpu/irq.c b/src/cpu/irq.c index 7b6ae7e..e6c6a80 100644 --- a/src/cpu/irq.c +++ b/src/cpu/irq.c @@ -120,6 +120,10 @@ void handle_data(unsigned char data) cmd[off] = (char) data; off += 1; add_thread(testfxn, 0, 3); + } else if (data == 0x62) { + cmd[off] = (char) data; + off += 1; + add_thread(uart_scheduler, 0, 2); // Else output } else { cmd[off] = (char) data; @@ -148,6 +152,31 @@ void handle_data(unsigned char data) write_string(&g_Drawer, cmd); } +void testfxn2(void) +{ + uart_string("Ran testfxn2\n"); +} + void testfxn(void) { + unsigned int i = 0x69420; + void* a = malloc(5); + void* b = malloc(3); + void* c = malloc(4); + void* d = malloc(4); + uart_string("Start\n"); + add_thread(testfxn2, 0, 0); + delay(0x20000000); + uart_string("Freeing B\n"); + free(b); + uart_string("Freeing A\n"); + free(a); + uart_string("Freeing C\n"); + free(c); + delay(0x20000000); + uart_string("Freeing D\n"); + free(d); + delay(0x20000000); + uart_hexn(i); + uart_string("End\n"); } |