aboutsummaryrefslogtreecommitdiff
path: root/kernel/lcd3.c
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2011-03-18 16:29:22 +0000
committerDimitri Sokolyuk <demon@dim13.org>2011-03-18 16:29:22 +0000
commit8be79f666b7be5e603e73dc443b7141a65da7cd9 (patch)
tree1ebcfa94e9947160902b9423a349297a5a5bed6e /kernel/lcd3.c
parent577488e08517172c1e926b6f3fb15a4ca9f6633f (diff)
ppm
Diffstat (limited to 'kernel/lcd3.c')
-rw-r--r--kernel/lcd3.c29
1 files changed, 22 insertions, 7 deletions
diff --git a/kernel/lcd3.c b/kernel/lcd3.c
index b4125b1..5fcae11 100644
--- a/kernel/lcd3.c
+++ b/kernel/lcd3.c
@@ -126,10 +126,27 @@ itoa(int32_t n)
return s;
}
+static char hex[] = "0123456789ABCDEF";
+
static char *
-itohex(uint32_t x)
+itohex16(uint16_t x)
+{
+ static char buf[5];
+ char *s = &buf[4];
+ uint8_t i;
+
+ *s = '\0';
+
+ for (i = 0; i < 16; i += 4)
+ *--s = hex[(x >> i) & 0x0f];
+
+ return s;
+}
+
+
+static char *
+itohex32(uint32_t x)
{
- static char hex[] = "0123456789ABCDEF";
static char buf[9];
char *s = &buf[8];
uint8_t i;
@@ -170,9 +187,6 @@ lcd(void *arg)
home();
- mvputs(0, 0, "ADC0");
- mvputs(1, 0, "ADC1");
-
for (;;) {
/*
t = previous() - 1; // 0 is idle
@@ -181,8 +195,9 @@ lcd(void *arg)
mvputs(1, 5, itohex(now()));
*/
- mvputs(0, 5, itohex(a->adc[0]));
- mvputs(1, 5, itohex(a->adc[1]));
+
+ mvputs(0, 0, itoa(a->adc[0]));
+ mvputs(1, 0, itoa(a->adc[1]));
lcdargs.r = lcdargs.d + MSEC(100);
lcdargs.d += MSEC(50);