aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Cunningham <cc@localhost>2022-02-05 02:35:20 -0700
committerChristian Cunningham <cc@localhost>2022-02-05 02:35:20 -0700
commit345f80249ddef46a0a90d763e1b5651bbf967078 (patch)
tree870648c0fd2917f433a9beb8aaf458fb81821e5e
parent3459ee85fc3ebeb28b426843b179d017160184f2 (diff)
Use new string formatting
-rw-r--r--src/drivers/uart.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/drivers/uart.c b/src/drivers/uart.c
index cc9c357..86fd4b0 100644
--- a/src/drivers/uart.c
+++ b/src/drivers/uart.c
@@ -1,4 +1,6 @@
#include <drivers/uart.h>
+#include <lib/kmem.h>
+#include <lib/strings.h>
#include <sys/schedule.h>
#define UART_BUFFER_SIZE 0x100
@@ -42,19 +44,9 @@ void uart_flush(void)
void uart_10(unsigned long val)
{
- unsigned long t = val;
- unsigned long c;
- static char buffer[11] = "0000000000\0";
- char* dptr = buffer + 9;
- for(int i = 0; i <= 10; i++) {
- c = t%10;
- *dptr = 0x30 + (c&0xF);
- t /= 10;
- if (t==0)
- break;
- dptr -= 1;
- }
+ char* dptr = u32_to_str(val);
uart_string(dptr);
+ kfree(dptr);
}
void uart_hexn(unsigned long c_val)