basic terminal
[cortex-from-scratch] / lib.c
diff --git a/lib.c b/lib.c
index 69bb12d..ba55c01 100644 (file)
--- a/lib.c
+++ b/lib.c
@@ -7,8 +7,9 @@
 /* Temporary libc functions, which can later be 
  * replaced by a *real* library */
 
-char hexbuf[8] = {'0', '0','0', '0','0', '0','0', '0'};
+char hexbuf[8];
 
+/* Still kind of a debug function */
 void addrtohex(uint32_t addr) {
        char tmpbuf[6] = {'A', 'B', 'C', 'D', 'E', 'F'};
        memset(&hexbuf, 0, sizeof(uint32_t) * 8);
@@ -25,11 +26,12 @@ void addrtohex(uint32_t addr) {
                }
        }
 
-       uart_puts("ADDRESS: 0x");
         for (int i = 7; i >= 0; i--) {
-               uart_putc(hexbuf[i]);
+               cputchar(hexbuf[i]);
        } 
-       //uart_puts(hexbuf);
-       uart_putc('\n');
 }
 
+
+
+
+