From d8b69803cf31c24c72ed80a9c10863db5ae3a90a Mon Sep 17 00:00:00 2001 From: reinelt <> Date: Mon, 6 Mar 2000 06:04:06 +0000 Subject: [lcd4linux @ 2000-03-06 06:04:06 by reinelt] minor cleanups --- MatrixOrbital.c | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'MatrixOrbital.c') diff --git a/MatrixOrbital.c b/MatrixOrbital.c index 38c2d26..c5dc6a7 100644 --- a/MatrixOrbital.c +++ b/MatrixOrbital.c @@ -6,12 +6,41 @@ #include #include +#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; } -- cgit v1.2.3