diff options
author | reinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f> | 2004-06-05 06:13:12 +0000 |
---|---|---|
committer | reinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f> | 2004-06-05 06:13:12 +0000 |
commit | d8ce1d7743380929b6070ea2bb1b8fb2016f195b (patch) | |
tree | fc05ede0a4eb4d4ceb6a787b1276d5c3c9bdb3a1 /drv_MatrixOrbital.c | |
parent | edad39d87fae7bb48e3e4e558be6805793ec80e9 (diff) | |
download | lcd4linux-d8ce1d7743380929b6070ea2bb1b8fb2016f195b.tar.gz |
[lcd4linux @ 2004-06-05 06:13:11 by reinelt]
splash screen for all text-based display drivers
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@463 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
Diffstat (limited to 'drv_MatrixOrbital.c')
-rw-r--r-- | drv_MatrixOrbital.c | 52 |
1 files changed, 40 insertions, 12 deletions
diff --git a/drv_MatrixOrbital.c b/drv_MatrixOrbital.c index 26ef3a6..d79ba19 100644 --- a/drv_MatrixOrbital.c +++ b/drv_MatrixOrbital.c @@ -1,4 +1,4 @@ -/* $Id: drv_MatrixOrbital.c,v 1.29 2004/06/02 09:41:19 reinelt Exp $ +/* $Id: drv_MatrixOrbital.c,v 1.30 2004/06/05 06:13:12 reinelt Exp $ * * new style driver for Matrix Orbital serial display modules * @@ -23,6 +23,10 @@ * * * $Log: drv_MatrixOrbital.c,v $ + * Revision 1.30 2004/06/05 06:13:12 reinelt + * + * splash screen for all text-based display drivers + * * Revision 1.29 2004/06/02 09:41:19 reinelt * * prepared support for startup splash screen @@ -163,6 +167,7 @@ #include "debug.h" #include "cfg.h" +#include "qprintf.h" #include "plugin.h" #include "widget.h" #include "widget_text.h" @@ -229,6 +234,19 @@ static MODEL Models[] = { // *** hardware dependant functions *** // **************************************** +static void drv_MO_clear (void) +{ + switch (Protocol) { + case 1: + drv_generic_serial_write ("\014", 1); // Clear Screen + break; + case 2: + drv_generic_serial_write ("\376\130", 2); // Clear Screen + break; + } +} + + static void drv_MO_write (int row, int col, unsigned char *data, int len) { char cmd[5]="\376Gyx"; @@ -395,7 +413,7 @@ static int drv_MO_rpm (int num) } -static int drv_MO_start (char *section) +static int drv_MO_start (char *section, int quiet) { int i; char *model; @@ -468,14 +486,7 @@ static int drv_MO_start (char *section) } } - switch (Protocol) { - case 1: - drv_generic_serial_write ("\014", 1); // Clear Screen - break; - case 2: - drv_generic_serial_write ("\376\130", 2); // Clear Screen - break; - } + drv_MO_clear(); drv_generic_serial_write ("\376B", 3); // backlight on drv_generic_serial_write ("\376K", 2); // cursor off @@ -493,6 +504,15 @@ static int drv_MO_start (char *section) drv_MO_backlight(i); } + if (!quiet) { + char buffer[40]; + qprintf(buffer, sizeof(buffer), "%s %dx%d", Name, DCOLS, DROWS); + if (drv_generic_text_greet (buffer)) { + sleep (3); + drv_MO_clear(); + } + } + return 0; } @@ -636,7 +656,7 @@ int drv_MO_init (char *section, int quiet) // start display - if ((ret=drv_MO_start (section))!=0) + if ((ret=drv_MO_start (section, quiet))!=0) return ret; // initialize generic text driver @@ -685,8 +705,16 @@ int drv_MO_init (char *section, int quiet) int drv_MO_quit (void) { info("%s: shutting down.", Name); - drv_generic_serial_close(); + drv_generic_text_quit(); + + // clear display + drv_MO_clear(); + + // say goodbye... + drv_generic_text_greet ("goodbye!"); + + drv_generic_serial_close(); return (0); } |