brewco/slcd.c

changeset 443
6b80a37fdf8d
parent 434
eb724767860d
child 446
78e9d5234d15
--- a/brewco/slcd.c	Sat Nov 28 21:00:29 2015 +0100
+++ b/brewco/slcd.c	Wed Dec 02 17:16:41 2015 +0100
@@ -138,9 +138,21 @@
 
 
 
-//void slcdCharDef(int fd, int index, unsigned char data[8])
-//{
-//}
+void slcdCharDef(int fd, int index, unsigned char data[8])
+{
+    int		i;
+    uint16_t	byte;
+
+    if (debug)
+	fprintf(stdout, "CharDef(%d, %d, %02x, %02x, %02x, %02x, %02x, %02x, %02x, %02x)\n", fd, index, data[0], data[1], data[2], data[3], data[4], data[5], data[6], data[7]);
+
+    byte = SLCD_CGRAM | ((index & 7) << 3);
+    putLCDsocket(fd, byte);
+    for (i = 0; i < 8; i++) {
+	byte = data[i] & 0xff;
+	putLCDsocket(fd, byte);
+    }
+}
 
 
 

mercurial