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 | |
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
-rw-r--r-- | drv_BeckmannEgle.c | 38 | ||||
-rw-r--r-- | drv_Crystalfontz.c | 61 | ||||
-rw-r--r-- | drv_Curses.c | 42 | ||||
-rw-r--r-- | drv_Cwlinux.c | 57 | ||||
-rw-r--r-- | drv_HD44780.c | 30 | ||||
-rw-r--r-- | drv_M50530.c | 38 | ||||
-rw-r--r-- | drv_MatrixOrbital.c | 52 | ||||
-rw-r--r-- | drv_MilfordInstruments.c | 36 | ||||
-rw-r--r-- | drv_USBLCD.c | 42 |
9 files changed, 327 insertions, 69 deletions
diff --git a/drv_BeckmannEgle.c b/drv_BeckmannEgle.c index 11ac10e..55d2197 100644 --- a/drv_BeckmannEgle.c +++ b/drv_BeckmannEgle.c @@ -1,4 +1,4 @@ -/* $Id: drv_BeckmannEgle.c,v 1.4 2004/06/02 09:41:19 reinelt Exp $ +/* $Id: drv_BeckmannEgle.c,v 1.5 2004/06/05 06:13:11 reinelt Exp $ * * driver for Beckmann+Egle mini terminals * Copyright 2000 Michael Reinelt <reinelt@eunet.at> @@ -22,6 +22,10 @@ * * * $Log: drv_BeckmannEgle.c,v $ + * Revision 1.5 2004/06/05 06:13:11 reinelt + * + * splash screen for all text-based display drivers + * * Revision 1.4 2004/06/02 09:41:19 reinelt * * prepared support for startup splash screen @@ -60,6 +64,7 @@ #include "debug.h" #include "cfg.h" +#include "qprintf.h" #include "plugin.h" #include "widget.h" #include "widget_text.h" @@ -138,7 +143,13 @@ static void drv_BE_defchar (int ascii, unsigned char *matrix) } -static int drv_BE_start (char *section) +static void drv_BE_clear (void) +{ + drv_generic_serial_write ("\033&#", 3); // clear +} + + +static int drv_BE_start (char *section, int quiet) { int i; char *model; @@ -170,8 +181,17 @@ static int drv_BE_start (char *section) buffer[4] = Models[Model].type; drv_generic_serial_write (buffer, 4); // select display type drv_generic_serial_write ("\033&D", 3); // cursor off - drv_generic_serial_write ("\033&#", 3); // clear + drv_BE_clear(); + + if (!quiet) { + char buffer[40]; + qprintf(buffer, sizeof(buffer), "B+E %s", Models[Model].name); + if (drv_generic_text_greet (buffer)) { + sleep (3); + drv_BE_clear(); + } + } return 0; } @@ -228,7 +248,7 @@ int drv_BE_init (char *section, int quiet) // start display - if ((ret=drv_BE_start (section))!=0) + if ((ret=drv_BE_start (section, quiet))!=0) return ret; // initialize generic text driver @@ -273,9 +293,17 @@ int drv_BE_init (char *section, int quiet) int drv_BE_quit (void) { info("%s: shutting down.", Name); - drv_generic_serial_close(); + drv_generic_text_quit(); + // clear display + drv_BE_clear(); + + // say goodbye... + drv_generic_text_greet ("goodbye!"); + + drv_generic_serial_close(); + return (0); } diff --git a/drv_Crystalfontz.c b/drv_Crystalfontz.c index 0ab226c..d30eda3 100644 --- a/drv_Crystalfontz.c +++ b/drv_Crystalfontz.c @@ -1,4 +1,4 @@ -/* $Id: drv_Crystalfontz.c,v 1.23 2004/06/02 09:41:19 reinelt Exp $ +/* $Id: drv_Crystalfontz.c,v 1.24 2004/06/05 06:13:11 reinelt Exp $ * * new style driver for Crystalfontz display modules * @@ -23,6 +23,10 @@ * * * $Log: drv_Crystalfontz.c,v $ + * Revision 1.24 2004/06/05 06:13:11 reinelt + * + * splash screen for all text-based display drivers + * * Revision 1.23 2004/06/02 09:41:19 reinelt * * prepared support for startup splash screen @@ -135,6 +139,7 @@ #include "debug.h" #include "cfg.h" +#include "qprintf.h" #include "timer.h" #include "plugin.h" #include "widget.h" @@ -667,6 +672,21 @@ static int drv_CF_scan_DOW (unsigned char index) } +// clear display +static void drv_CF_clear (void) +{ + switch (Protocol) { + case 1: + drv_generic_serial_write ("\014", 1); + break; + case 2: + case 3: + drv_CF_send ( 6, 0, NULL); + break; + } +} + + // init sequences for 626, 632, 634, 636 static void drv_CF_start_1 (void) { @@ -780,25 +800,30 @@ static int drv_CF_start (char *section) Protocol = Models[Model].protocol; Payload = Models[Model].payload; - // regularly process display answers - // Fixme: make 100msec configurable - timer_add (drv_CF_timer, NULL, 100, 0); switch (Protocol) { + case 1: drv_CF_start_1(); break; + case 2: + // regularly process display answers + // Fixme: make 100msec configurable + timer_add (drv_CF_timer, NULL, 100, 0); drv_CF_start_2(); + // clear 633 linebuffer + memset (Line, ' ', sizeof(Line)); break; + case 3: + // regularly process display answers + // Fixme: make 100msec configurable + timer_add (drv_CF_timer, NULL, 100, 0); drv_CF_start_3(); break; } - // clear 633 linebuffer - memset (Line, ' ', sizeof(Line)); - // set contrast if (cfg_number(section, "Contrast", 0, 0, 255, &i)>0) { drv_CF_contrast(i); @@ -914,8 +939,9 @@ int drv_CF_init (char *section, int quiet) int ret; // start display - if ((ret=drv_CF_start (section))!=0) + if ((ret = drv_CF_start (section)) != 0) { return ret; + } // display preferences XRES = 6; // pixel width of one char @@ -944,6 +970,15 @@ int drv_CF_init (char *section, int quiet) break; } + if (!quiet) { + char buffer[40]; + qprintf(buffer, sizeof(buffer), "%s %s", Name, Models[Model].name); + if (drv_generic_text_greet (buffer)) { + sleep (3); + drv_CF_clear(); + } + } + // initialize generic text driver if ((ret=drv_generic_text_init(section, Name))!=0) return ret; @@ -991,8 +1026,16 @@ int drv_CF_init (char *section, int quiet) int drv_CF_quit (void) { info("%s: shutting down.", Name); - drv_generic_serial_close(); + drv_generic_text_quit(); + + // clear display + drv_CF_clear(); + + // say goodbye... + drv_generic_text_greet ("goodbye!"); + + drv_generic_serial_close(); return (0); } diff --git a/drv_Curses.c b/drv_Curses.c index 13e53e9..8b2fbf0 100644 --- a/drv_Curses.c +++ b/drv_Curses.c @@ -1,4 +1,4 @@ -/* $Id: drv_Curses.c,v 1.2 2004/06/02 09:41:19 reinelt Exp $ +/* $Id: drv_Curses.c,v 1.3 2004/06/05 06:13:11 reinelt Exp $ * * pure ncurses based text driver * @@ -26,6 +26,10 @@ * * * $Log: drv_Curses.c,v $ + * Revision 1.3 2004/06/05 06:13:11 reinelt + * + * splash screen for all text-based display drivers + * * Revision 1.2 2004/06/02 09:41:19 reinelt * * prepared support for startup splash screen @@ -55,6 +59,7 @@ #include "debug.h" #include "cfg.h" +#include "qprintf.h" #include "plugin.h" #include "widget.h" #include "widget_text.h" @@ -75,6 +80,14 @@ static int EROWS; // *** hardware dependant functions *** // **************************************** +static void drv_Curs_clear (void) +{ + werase (w); + box (w, 0, 0); + wrefresh (w); +} + + static void drv_Curs_write (int row, int col, unsigned char *data, int len) { char *p; @@ -86,7 +99,6 @@ static void drv_Curs_write (int row, int col, unsigned char *data, int len) if (col < DCOLS) { if (DCOLS-col < len ) len = DCOLS-col; mvwprintw(w, row+1 , col+1, "%.*s", DCOLS-col, data); - box(w, 0, 0); wmove(w, DROWS+1, 0); wrefresh(w); } @@ -141,7 +153,7 @@ int curses_error(char *buffer) } -static int drv_Curs_start (char *section) +static int drv_Curs_start (char *section, int quiet) { char *s; @@ -181,10 +193,17 @@ static int drv_Curs_start (char *section) wrefresh(e); } - werase (w); - box (w, 0, 0); - wrefresh (w); + drv_Curs_clear(); + if (!quiet) { + char buffer[40]; + qprintf(buffer, sizeof(buffer), "%s %dx%d", Name, DCOLS, DROWS); + if (drv_generic_text_greet (buffer)) { + sleep (3); + drv_Curs_clear(); + } + } + return 0; } @@ -235,8 +254,9 @@ int drv_Curs_init (char *section, int quiet) drv_generic_text_real_defchar = drv_Curs_defchar; // start display - if ((ret = drv_Curs_start (section)) != 0) + if ((ret = drv_Curs_start (section, quiet)) != 0) { return ret; + } // initialize generic text driver if ((ret = drv_generic_text_init(section, Name)) != 0) @@ -271,7 +291,15 @@ int drv_Curs_init (char *section, int quiet) int drv_Curs_quit (void) { info("%s: shutting down.", Name); + drv_generic_text_quit(); + + // clear display + drv_Curs_clear(); + + // say goodbye... + drv_generic_text_greet ("goodbye!"); + endwin(); return (0); diff --git a/drv_Cwlinux.c b/drv_Cwlinux.c index fb1915e..484560b 100644 --- a/drv_Cwlinux.c +++ b/drv_Cwlinux.c @@ -1,4 +1,4 @@ -/* $Id: drv_Cwlinux.c,v 1.12 2004/06/02 09:41:19 reinelt Exp $ +/* $Id: drv_Cwlinux.c,v 1.13 2004/06/05 06:13:11 reinelt Exp $ * * new style driver for Cwlinux display modules * @@ -23,6 +23,10 @@ * * * $Log: drv_Cwlinux.c,v $ + * Revision 1.13 2004/06/05 06:13:11 reinelt + * + * splash screen for all text-based display drivers + * * Revision 1.12 2004/06/02 09:41:19 reinelt * * prepared support for startup splash screen @@ -97,6 +101,7 @@ #include "debug.h" #include "cfg.h" +#include "qprintf.h" #include "plugin.h" #include "widget.h" #include "widget_text.h" @@ -189,6 +194,22 @@ static void drv_CW12232_defchar (int ascii, unsigned char *buffer) } +static void drv_CW_clear (void) +{ +#if 0 + drv_generic_serial_write("\376X\375",3); // Clear Display +#else + // for some mysterious reason, we have to sleep after + // the command _and_ after the CMD_END... + usleep(20); + drv_generic_serial_write("\376X",2); // Clear Display + usleep(20); + drv_generic_serial_write("\375",1); // Command End + usleep(20); +#endif +} + + static int drv_CW_brightness (int brightness) { static unsigned char Brightness = 0; @@ -221,7 +242,7 @@ static int drv_CW_brightness (int brightness) } -static int drv_CW_start (char *section) +static int drv_CW_start (char *section, int quiet) { int i; char *model; @@ -267,17 +288,7 @@ static int drv_CW_start (char *section) GPOS = Models[Model].gpos; Protocol = Models[Model].protocol; -#if 0 - drv_generic_serial_write("\376X\375",3); // Clear Display -#else - // for some mysterious reason, we have to sleep after - // the command _and_ after the CMD_END... - usleep(20); - drv_generic_serial_write("\376X",2); // Clear Display - usleep(20); - drv_generic_serial_write("\375",1); // Command End - usleep(20); -#endif + drv_CW_clear(); drv_generic_serial_write ("\376D\375", 3); // auto line wrap off drv_generic_serial_write ("\376R\375", 3); // auto scroll off @@ -289,6 +300,15 @@ static int drv_CW_start (char *section) drv_CW_brightness(i); } + if (!quiet) { + char buffer[40]; + qprintf(buffer, sizeof(buffer), "%s %s", Name, Models[Model].name); + if (drv_generic_text_greet (buffer)) { + sleep (3); + drv_CW_clear(); + } + } + return 0; } @@ -358,7 +378,7 @@ int drv_CW_init (char *section, int quiet) GOTO_COST = 3; // number of bytes a goto command requires // start display - if ((ret=drv_CW_start (section))!=0) + if ((ret=drv_CW_start (section, quiet))!=0) return ret; // real worker functions @@ -414,8 +434,15 @@ int drv_CW_init (char *section, int quiet) int drv_CW_quit (void) { info("%s: shutting down.", Name); - drv_generic_serial_close(); drv_generic_text_quit(); + + // clear *both* displays + drv_CW_clear(); + + // say goodbye... + drv_generic_text_greet ("goodbye!"); + + drv_generic_serial_close(); return (0); } diff --git a/drv_HD44780.c b/drv_HD44780.c index b9a6f69..03df8ab 100644 --- a/drv_HD44780.c +++ b/drv_HD44780.c @@ -1,4 +1,4 @@ -/* $Id: drv_HD44780.c,v 1.26 2004/06/02 10:09:22 reinelt Exp $ +/* $Id: drv_HD44780.c,v 1.27 2004/06/05 06:13:11 reinelt Exp $ * * new style driver for HD44780-based displays * @@ -29,6 +29,10 @@ * * * $Log: drv_HD44780.c,v $ + * Revision 1.27 2004/06/05 06:13:11 reinelt + * + * splash screen for all text-based display drivers + * * Revision 1.26 2004/06/02 10:09:22 reinelt * * splash screen for HD44780 @@ -497,6 +501,12 @@ static void drv_HD_data (unsigned char controller, char *string, int len, int de } +static void drv_HD_clear (void) +{ + drv_HD_command (allControllers, 0x01, T_CLEAR); // clear *both* displays +} + + static void drv_HD_goto (int row, int col) { int pos; @@ -722,7 +732,7 @@ static int drv_HD_start (char *section, int quiet) drv_HD_command (allControllers, Bits==8?0x38:0x28, T_EXEC); // clear extended register enable bit } - drv_HD_command (allControllers, 0x01, T_CLEAR); // clear *both* displays + drv_HD_clear(); // clear *both* displays drv_HD_command (allControllers, 0x03, T_CLEAR); // return home // maybe set brightness @@ -738,7 +748,7 @@ static int drv_HD_start (char *section, int quiet) qprintf(buffer, sizeof(buffer), "%s %dx%d", Name, DCOLS, DROWS); if (drv_generic_text_greet (buffer)) { sleep (3); - drv_HD_command (allControllers, 0x01, T_CLEAR); // clear *both* displays + drv_HD_clear(); } } @@ -862,8 +872,18 @@ int drv_HD_quit (void) { drv_generic_text_quit(); - drv_HD_command (allControllers, 0x01, T_CLEAR); // clear *both* displays - drv_generic_text_greet ("good bye!"); + // clear *both* displays + drv_HD_clear(); + + // say goodbye... + drv_generic_text_greet ("goodbye!"); + + // clear all signals + if (Bits==8) { + drv_generic_parport_control (SIGNAL_RS|SIGNAL_RW|SIGNAL_ENABLE|SIGNAL_ENABLE2|SIGNAL_GPO, 0); + } else { + drv_generic_parport_data (0); + } drv_generic_parport_close(); diff --git a/drv_M50530.c b/drv_M50530.c index 018862c..920d56e 100644 --- a/drv_M50530.c +++ b/drv_M50530.c @@ -1,4 +1,4 @@ -/* $Id: drv_M50530.c,v 1.8 2004/06/02 09:41:19 reinelt Exp $ +/* $Id: drv_M50530.c,v 1.9 2004/06/05 06:13:12 reinelt Exp $ * * new style driver for M50530-based displays * @@ -23,6 +23,10 @@ * * * $Log: drv_M50530.c,v $ + * Revision 1.9 2004/06/05 06:13:12 reinelt + * + * splash screen for all text-based display drivers + * * Revision 1.8 2004/06/02 09:41:19 reinelt * * prepared support for startup splash screen @@ -86,6 +90,7 @@ #include "debug.h" #include "cfg.h" +#include "qprintf.h" #include "udelay.h" #include "plugin.h" #include "widget.h" @@ -151,6 +156,12 @@ static void drv_M5_command (unsigned int cmd, int delay) } +static void drv_M5_clear (void) +{ + drv_M5_command (0x0001, 1250); // clear display +} + + static void drv_M5_write (int row, int col, unsigned char *data, int len) { unsigned int cmd; @@ -201,7 +212,7 @@ static void drv_M5_setGPO (int bits) #endif -static int drv_M5_start (char *section) +static int drv_M5_start (char *section, int quiet) { char *model, *s; int rows=-1, cols=-1, gpos=-1; @@ -260,8 +271,18 @@ static int drv_M5_start (char *section) drv_M5_command (0x0020, 20); // set display mode drv_M5_command (0x0050, 20); // set entry mode drv_M5_command (0x0030, 20); // set display mode - drv_M5_command (0x0001, 1250); // clear display + + drv_M5_clear(); + if (!quiet) { + char buffer[40]; + qprintf(buffer, sizeof(buffer), "%s %dx%d", Name, DCOLS, DROWS); + if (drv_generic_text_greet (buffer)) { + sleep (3); + drv_M5_clear(); + } + } + return 0; } @@ -318,7 +339,7 @@ int drv_M5_init (char *section, int quiet) // start display - if ((ret=drv_M5_start (section))!=0) + if ((ret=drv_M5_start (section, quiet))!=0) return ret; // initialize generic text driver @@ -363,11 +384,18 @@ int drv_M5_quit (void) { info("%s: shutting down.", Name); + drv_generic_text_quit(); + + // clear display + drv_M5_clear(); + + // say goodbye... + drv_generic_text_greet ("goodbye!"); + // clear all signals drv_generic_parport_control (SIGNAL_EX|SIGNAL_IOC1|SIGNAL_IOC2|SIGNAL_GPO, 0); drv_generic_parport_close(); - drv_generic_text_quit(); return (0); } 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); } diff --git a/drv_MilfordInstruments.c b/drv_MilfordInstruments.c index 32b29ab..14d9e62 100644 --- a/drv_MilfordInstruments.c +++ b/drv_MilfordInstruments.c @@ -1,4 +1,4 @@ -/* $Id: drv_MilfordInstruments.c,v 1.6 2004/06/02 09:41:19 reinelt Exp $ +/* $Id: drv_MilfordInstruments.c,v 1.7 2004/06/05 06:13:12 reinelt Exp $ * * driver for Milford Instruments 'BPK' piggy-back serial interface board * for standard Hitachi 44780 compatible lcd modules. @@ -27,6 +27,10 @@ * * * $Log: drv_MilfordInstruments.c,v $ + * Revision 1.7 2004/06/05 06:13:12 reinelt + * + * splash screen for all text-based display drivers + * * Revision 1.6 2004/06/02 09:41:19 reinelt * * prepared support for startup splash screen @@ -66,6 +70,7 @@ #include "debug.h" #include "cfg.h" +#include "qprintf.h" #include "plugin.h" #include "widget.h" #include "widget_text.h" @@ -100,6 +105,12 @@ static int Model; // *** hardware dependant functions *** // **************************************** +static void drv_MI_clear (void) +{ + drv_generic_serial_write ("\376\001", 2); // clear screen +} + + static void drv_MI_write (int row, int col, unsigned char *data, int len) { char cmd[2] = "\376x"; @@ -132,7 +143,7 @@ static void drv_MI_defchar (int ascii, unsigned char *matrix) } -static int drv_MI_start (char *section) +static int drv_MI_start (char *section, int quiet) { int i; char *model; @@ -159,9 +170,16 @@ static int drv_MI_start (char *section) DROWS = Models[Model].rows; DCOLS = Models[Model].cols; - drv_generic_serial_write ("\376\001", 2); // clear screen + drv_MI_clear(); drv_generic_serial_write ("\376\014", 2); // cursor off + if (!quiet) { + if (drv_generic_text_greet (Models[Model].name)) { + sleep (3); + drv_MI_clear(); + } + } + return 0; } @@ -218,7 +236,7 @@ int drv_MI_init (char *section, int quiet) // start display - if ((ret=drv_MI_start (section))!=0) + if ((ret=drv_MI_start (section, quiet))!=0) return ret; // initialize generic text driver @@ -263,8 +281,16 @@ int drv_MI_init (char *section, int quiet) int drv_MI_quit (void) { info("%s: shutting down.", Name); - drv_generic_serial_close(); + drv_generic_text_quit(); + + // clear display + drv_MI_clear(); + + // say goodbye... + drv_generic_text_greet ("goodbye!"); + + drv_generic_serial_close(); return (0); } diff --git a/drv_USBLCD.c b/drv_USBLCD.c index a185e13..eb8d9bd 100644 --- a/drv_USBLCD.c +++ b/drv_USBLCD.c @@ -1,4 +1,4 @@ -/* $Id: drv_USBLCD.c,v 1.6 2004/06/02 09:41:19 reinelt Exp $ +/* $Id: drv_USBLCD.c,v 1.7 2004/06/05 06:13:12 reinelt Exp $ * * new style driver for USBLCD displays * @@ -26,6 +26,10 @@ * * * $Log: drv_USBLCD.c,v $ + * Revision 1.7 2004/06/05 06:13:12 reinelt + * + * splash screen for all text-based display drivers + * * Revision 1.6 2004/06/02 09:41:19 reinelt * * prepared support for startup splash screen @@ -77,6 +81,7 @@ #include "debug.h" #include "cfg.h" +#include "qprintf.h" #include "udelay.h" #include "plugin.h" #include "widget.h" @@ -131,6 +136,12 @@ static void drv_UL_command (unsigned char cmd) } +static void drv_UL_clear (void) +{ + drv_UL_command (0x01); // clear display +} + + static void drv_UL_write (int row, int col, unsigned char *data, int len) { int pos = (row%2)*64 + (row/2)*20 + col; @@ -159,7 +170,7 @@ static void drv_UL_defchar (int ascii, unsigned char *matrix) } -static int drv_UL_start (char *section) +static int drv_UL_start (char *section, int quiet) { int rows=-1, cols=-1; int major, minor; @@ -252,12 +263,22 @@ static int drv_UL_start (char *section) drv_UL_command (0x08); // Display off, cursor off, blink off drv_UL_command (0x0c); // Display on, cursor off, blink off drv_UL_command (0x06); // curser moves to right, no shift - drv_UL_command (0x01); // clear display + drv_UL_clear(); // clear display drv_UL_command (0x03); // return home // flush buffer drv_UL_send(); + if (!quiet) { + char buffer[40]; + qprintf(buffer, sizeof(buffer), "%s %dx%d", Name, DCOLS, DROWS); + if (drv_generic_text_greet (buffer)) { + sleep (3); + drv_UL_clear(); + drv_UL_send(); + } + } + return 0; } @@ -312,7 +333,7 @@ int drv_UL_init (char *section, int quiet) // start display - if ((ret=drv_UL_start (section))!=0) + if ((ret=drv_UL_start (section, quiet))!=0) return ret; // initialize generic text driver @@ -368,6 +389,17 @@ int drv_UL_quit (void) // flush buffer drv_UL_send(); + drv_generic_text_quit(); + + // clear display + drv_UL_clear(); + + // say goodbye... + drv_generic_text_greet ("goodbye!"); + + // flush buffer + drv_UL_send(); + debug ("closing port %s", Port); close(usblcd_file); @@ -377,8 +409,6 @@ int drv_UL_quit (void) BufPtr=Buffer; } - drv_generic_text_quit(); - return (0); } |