aboutsummaryrefslogtreecommitdiffstats
path: root/MatrixOrbital.c
diff options
context:
space:
mode:
authorreinelt <>2000-03-06 06:04:06 +0000
committerreinelt <>2000-03-06 06:04:06 +0000
commitd8b69803cf31c24c72ed80a9c10863db5ae3a90a (patch)
treec29227526b71f99f88185e9c6e9e6ae5b1cc6021 /MatrixOrbital.c
parent58b1cb05eae15b6eb87dd35b63ba562d6392e7eb (diff)
downloadlcd4linux-d8b69803cf31c24c72ed80a9c10863db5ae3a90a.tar.gz
[lcd4linux @ 2000-03-06 06:04:06 by reinelt]
minor cleanups
Diffstat (limited to 'MatrixOrbital.c')
-rw-r--r--MatrixOrbital.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/MatrixOrbital.c b/MatrixOrbital.c
index 38c2d26..c5dc6a7 100644
--- a/MatrixOrbital.c
+++ b/MatrixOrbital.c
@@ -6,12 +6,41 @@
#include <string.h>
#include <errno.h>
+#include "config.h"
#include "display.h"
+static DISPLAY Display;
+static char *Device=NULL;
-int MO_init (void)
+int MO_init (DISPLAY *Self)
{
+ char *port;
+
printf ("initializing MatrixOrbital...\n");
+
+ if (Device) {
+ free (Device);
+ Device=NULL;
+ }
+
+ port=cfg_get ("port");
+ if (port==NULL || *port=='\0') {
+ fprintf (stderr, "MatrixOrbital: no 'port' entry in %s\n", cfg_file());
+ return -1;
+ }
+ Device=strdup(port);
+
+ lcd=lcd_open();
+ if (lcd==-1) return -1;
+
+ lcd_clear();
+ lcd_write ("\376B", 3); // backlight on
+ lcd_write ("\376K", 2); // cursor off
+ lcd_write ("\376T", 2); // blink off
+ lcd_write ("\376D", 2); // line wrapping off
+ lcd_write ("\376R", 2); // auto scroll off
+ lcd_write ("\376V", 2); // GPO off
+
return 0;
}