From 468167fce9d64cb8f08832dd7586dd55f9200fb8 Mon Sep 17 00:00:00 2001 From: Christian Cunningham Date: Sat, 12 Mar 2022 09:47:04 -0800 Subject: Draw Base-10 Numbers Easier --- src/graphics/lfb.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/graphics') diff --git a/src/graphics/lfb.c b/src/graphics/lfb.c index 8c9c395..7158afa 100644 --- a/src/graphics/lfb.c +++ b/src/graphics/lfb.c @@ -3,6 +3,7 @@ #include #include #include +#include unsigned char *lfb; /* raw frame buffer address */ @@ -202,3 +203,16 @@ void draw_hex32(unsigned int lx, unsigned int ly, unsigned long val) { draw_chex32(lx, ly, val, 0xFFFFFF); } + +unsigned long draw_cu10(unsigned int lx, unsigned int ly, unsigned long val, unsigned int c) +{ + string_t vals = u32_to_str(val); + unsigned long len = strlen(vals); + draw_cstring(lx, ly, vals, c); + return len; +} + +unsigned long draw_u10(unsigned int lx, unsigned int ly, unsigned long val) +{ + return draw_cu10(lx, ly, val, 0xFFFFFF); +} -- cgit v1.2.1