diff options
author | reinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f> | 2000-03-06 06:04:06 +0000 |
---|---|---|
committer | reinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f> | 2000-03-06 06:04:06 +0000 |
commit | 164a0b9f9a7efe4c717b38b7b2c13b2e83b6bf66 (patch) | |
tree | c29227526b71f99f88185e9c6e9e6ae5b1cc6021 /MatrixOrbital.c | |
parent | 3d773c59e479921ea9acc1272798dec5a49e9de8 (diff) | |
download | lcd4linux-164a0b9f9a7efe4c717b38b7b2c13b2e83b6bf66.tar.gz |
[lcd4linux @ 2000-03-06 06:04:06 by reinelt]
minor cleanups
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@4 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
Diffstat (limited to '')
-rw-r--r-- | MatrixOrbital.c | 31 |
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; } |