From a671fda51c8a74d7e3657d6ba6808aee3fd58725 Mon Sep 17 00:00:00 2001 From: Byron Lathi Date: Mon, 14 Mar 2022 10:46:36 -0500 Subject: [PATCH] Add sample puts function "Hello, world!" :) --- sw/main.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sw/main.c b/sw/main.c index c7a5217..b72826f 100644 --- a/sw/main.c +++ b/sw/main.c @@ -1,10 +1,24 @@ #include #include "sevenseg.h" +#include "uart.h" + +void puts(const char* s) +{ + while (*s) { + uart_txb_block(*s); + if (*s == '\n') + uart_txb_block('\r'); + + s++; + } +} int main() { hex_enable(0x3f); hex_set_24(0xabcdef); + + puts("Hello, World!\n"); while(1); return 0; }