aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2004-06-02 09:41:19 +0000
committerreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2004-06-02 09:41:19 +0000
commit246b8539fe86f8e6636e18b65b70da3169dfabd6 (patch)
treefac33297acc1a4d6d49c686f0cac8f2139face8e
parentb07a5205b19d8e46596d748af8e070bfd58949e5 (diff)
downloadlcd4linux-246b8539fe86f8e6636e18b65b70da3169dfabd6.tar.gz
[lcd4linux @ 2004-06-02 09:41:19 by reinelt]
prepared support for startup splash screen git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@461 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
-rw-r--r--drv.c61
-rw-r--r--drv.h15
-rw-r--r--drv_BeckmannEgle.c8
-rw-r--r--drv_Crystalfontz.c8
-rw-r--r--drv_Curses.c8
-rw-r--r--drv_Cwlinux.c8
-rw-r--r--drv_HD44780.c50
-rw-r--r--drv_Image.c8
-rw-r--r--drv_M50530.c8
-rw-r--r--drv_MatrixOrbital.c8
-rw-r--r--drv_MilfordInstruments.c8
-rw-r--r--drv_NULL.c8
-rw-r--r--drv_T6963.c8
-rw-r--r--drv_USBLCD.c8
-rw-r--r--drv_X11.c8
-rw-r--r--layout.c8
-rw-r--r--lcd4linux.c87
-rw-r--r--lcd4linux.conf.sample8
18 files changed, 211 insertions, 114 deletions
diff --git a/drv.c b/drv.c
index 7077497..9fc724a 100644
--- a/drv.c
+++ b/drv.c
@@ -1,4 +1,4 @@
-/* $Id: drv.c,v 1.15 2004/05/31 16:39:06 reinelt Exp $
+/* $Id: drv.c,v 1.16 2004/06/02 09:41:19 reinelt Exp $
*
* new framework for display drivers
*
@@ -23,6 +23,10 @@
*
*
* $Log: drv.c,v $
+ * Revision 1.16 2004/06/02 09:41:19 reinelt
+ *
+ * prepared support for startup splash screen
+ *
* Revision 1.15 2004/05/31 16:39:06 reinelt
*
* added NULL display driver (for debugging/profiling purposes)
@@ -203,13 +207,52 @@ DRIVER *Driver[] = {
static DRIVER *Drv = NULL;
+// Fixme
+char* drv_hello (int line, int cols)
+{
+ int i;
+ static char *line1[] = { "* LCD4Linux " VERSION " *",
+ "LCD4Linux " VERSION,
+ "* LCD4Linux *",
+ "LCD4Linux",
+ "L4Linux",
+ NULL };
+
+ static char *line2[] = { "http://lcd4linux.sourceforge.net",
+ "lcd4linux.sourceforge.net",
+ "http://lcd4linux.sf.net",
+ "lcd4linux.sf.net",
+ NULL };
+
+
+ switch (line) {
+ case 1:
+ for (i = 0; line1[i]; i++) {
+ if (strlen(line1[i]) <= cols) {
+ return line1[i];
+ }
+ }
+ break;
+ case 2:
+ for (i = 0; line2[i]; i++) {
+ if (strlen(line2[i]) <= cols) {
+ return line2[i];
+ }
+ }
+ break;
+ }
+
+ return NULL;
+}
+
+
int drv_list (void)
{
int i;
printf ("available display drivers:");
- for (i=0; Driver[i]; i++) {
+ for (i = 0; Driver[i]; i++) {
printf ("\n %-20s: ", Driver[i]->name);
if (Driver[i]->list) Driver[i]->list();
}
@@ -218,14 +261,14 @@ int drv_list (void)
}
-int drv_init (char *section, char *driver)
+int drv_init (char *section, char *driver, int quiet)
{
int i;
- for (i=0; Driver[i]; i++) {
- if (strcmp (Driver[i]->name, driver)==0) {
- Drv=Driver[i];
- if (Drv->init==NULL) return 0;
- return Drv->init(section);
+ for (i = 0; Driver[i]; i++) {
+ if (strcmp (Driver[i]->name, driver) == 0) {
+ Drv = Driver[i];
+ if (Drv->init == NULL) return 0;
+ return Drv->init(section, quiet);
}
}
error ("drv_init(%s) failed: no such driver", driver);
@@ -235,6 +278,6 @@ int drv_init (char *section, char *driver)
int drv_quit (void)
{
- if (Drv->quit==NULL) return 0;
+ if (Drv->quit == NULL) return 0;
return Drv->quit();
}
diff --git a/drv.h b/drv.h
index 1cac26c..7bceea2 100644
--- a/drv.h
+++ b/drv.h
@@ -1,4 +1,4 @@
-/* $Id: drv.h,v 1.3 2004/01/20 15:32:49 reinelt Exp $
+/* $Id: drv.h,v 1.4 2004/06/02 09:41:19 reinelt Exp $
*
* new framework for display drivers
*
@@ -23,6 +23,10 @@
*
*
* $Log: drv.h,v $
+ * Revision 1.4 2004/06/02 09:41:19 reinelt
+ *
+ * prepared support for startup splash screen
+ *
* Revision 1.3 2004/01/20 15:32:49 reinelt
* first version of Next Generation HD44780 (untested! but it compiles...)
* some cleanup in the other drivers
@@ -48,7 +52,8 @@
typedef struct DRIVER {
char *name;
int (*list) (void);
- int (*init) (char *section);
+ int (*init) (char *section, int quiet);
+ int (*greet) (int start_stop);
int (*quit) (void);
} DRIVER;
@@ -58,8 +63,8 @@ typedef struct DRIVER {
// even if the raster driver is not included!
extern char *output;
-int drv_list (void);
-int drv_init (char *section, char *driver);
-int drv_quit (void);
+int drv_list (void);
+int drv_init (char *section, char *driver, int quiet);
+int drv_quit (void);
#endif
diff --git a/drv_BeckmannEgle.c b/drv_BeckmannEgle.c
index b6a6e40..11ac10e 100644
--- a/drv_BeckmannEgle.c
+++ b/drv_BeckmannEgle.c
@@ -1,4 +1,4 @@
-/* $Id: drv_BeckmannEgle.c,v 1.3 2004/06/02 05:14:16 reinelt Exp $
+/* $Id: drv_BeckmannEgle.c,v 1.4 2004/06/02 09:41:19 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.4 2004/06/02 09:41:19 reinelt
+ *
+ * prepared support for startup splash screen
+ *
* Revision 1.3 2004/06/02 05:14:16 reinelt
*
* fixed models listing for Beckmann+Egle driver
@@ -206,7 +210,7 @@ int drv_BE_list (void)
// initialize driver & display
-int drv_BE_init (char *section)
+int drv_BE_init (char *section, int quiet)
{
WIDGET_CLASS wc;
int ret;
diff --git a/drv_Crystalfontz.c b/drv_Crystalfontz.c
index 00d5397..0ab226c 100644
--- a/drv_Crystalfontz.c
+++ b/drv_Crystalfontz.c
@@ -1,4 +1,4 @@
-/* $Id: drv_Crystalfontz.c,v 1.22 2004/06/02 05:56:25 reinelt Exp $
+/* $Id: drv_Crystalfontz.c,v 1.23 2004/06/02 09:41:19 reinelt Exp $
*
* new style driver for Crystalfontz display modules
*
@@ -23,6 +23,10 @@
*
*
* $Log: drv_Crystalfontz.c,v $
+ * Revision 1.23 2004/06/02 09:41:19 reinelt
+ *
+ * prepared support for startup splash screen
+ *
* Revision 1.22 2004/06/02 05:56:25 reinelt
*
* extended contrast range for Crystalfontz
@@ -904,7 +908,7 @@ int drv_CF_list (void)
// initialize driver & display
-int drv_CF_init (char *section)
+int drv_CF_init (char *section, int quiet)
{
WIDGET_CLASS wc;
int ret;
diff --git a/drv_Curses.c b/drv_Curses.c
index 8c94668..13e53e9 100644
--- a/drv_Curses.c
+++ b/drv_Curses.c
@@ -1,4 +1,4 @@
-/* $Id: drv_Curses.c,v 1.1 2004/05/26 11:37:36 reinelt Exp $
+/* $Id: drv_Curses.c,v 1.2 2004/06/02 09:41:19 reinelt Exp $
*
* pure ncurses based text driver
*
@@ -26,6 +26,10 @@
*
*
* $Log: drv_Curses.c,v $
+ * Revision 1.2 2004/06/02 09:41:19 reinelt
+ *
+ * prepared support for startup splash screen
+ *
* Revision 1.1 2004/05/26 11:37:36 reinelt
*
* Curses driver ported.
@@ -214,7 +218,7 @@ int drv_Curs_list (void)
// initialize driver & display
-int drv_Curs_init (char *section)
+int drv_Curs_init (char *section, int quiet)
{
WIDGET_CLASS wc;
int ret;
diff --git a/drv_Cwlinux.c b/drv_Cwlinux.c
index 54e340a..fb1915e 100644
--- a/drv_Cwlinux.c
+++ b/drv_Cwlinux.c
@@ -1,4 +1,4 @@
-/* $Id: drv_Cwlinux.c,v 1.11 2004/06/01 06:45:29 reinelt Exp $
+/* $Id: drv_Cwlinux.c,v 1.12 2004/06/02 09:41:19 reinelt Exp $
*
* new style driver for Cwlinux display modules
*
@@ -23,6 +23,10 @@
*
*
* $Log: drv_Cwlinux.c,v $
+ * Revision 1.12 2004/06/02 09:41:19 reinelt
+ *
+ * prepared support for startup splash screen
+ *
* Revision 1.11 2004/06/01 06:45:29 reinelt
*
* some Fixme's processed
@@ -341,7 +345,7 @@ int drv_CW_list (void)
// initialize driver & display
-int drv_CW_init (char *section)
+int drv_CW_init (char *section, int quiet)
{
WIDGET_CLASS wc;
int ret;
diff --git a/drv_HD44780.c b/drv_HD44780.c
index 026160a..6833dd9 100644
--- a/drv_HD44780.c
+++ b/drv_HD44780.c
@@ -1,4 +1,4 @@
-/* $Id: drv_HD44780.c,v 1.24 2004/06/01 06:45:29 reinelt Exp $
+/* $Id: drv_HD44780.c,v 1.25 2004/06/02 09:41:19 reinelt Exp $
*
* new style driver for HD44780-based displays
*
@@ -29,6 +29,10 @@
*
*
* $Log: drv_HD44780.c,v $
+ * Revision 1.25 2004/06/02 09:41:19 reinelt
+ *
+ * prepared support for startup splash screen
+ *
* Revision 1.24 2004/06/01 06:45:29 reinelt
*
* some Fixme's processed
@@ -162,6 +166,7 @@
#include "debug.h"
#include "cfg.h"
#include "udelay.h"
+#include "qprintf.h"
#include "plugin.h"
#include "widget.h"
#include "widget_text.h"
@@ -770,7 +775,7 @@ int drv_HD_list (void)
// initialize driver & display
-int drv_HD_init (char *section)
+int drv_HD_init (char *section, int quiet)
{
WIDGET_CLASS wc;
int asc255bug;
@@ -836,6 +841,47 @@ int drv_HD_init (char *section)
}
+// say hello to the user
+static int drv_HD_greet (int start_stop)
+{
+ int flag = 0;
+ char buffer[40];
+ char *msg;
+
+ drv_HD_command (allControllers, 0x01, T_CLEAR); // clear *both* displays
+
+ msg = drv_hello (1, DCOLS);
+ if (msg != NULL) {
+ drv_HD_write (0, (DCOLS-strlen(msg))/2, msg, strlen(msg));
+ flag = 1;
+ }
+
+ if (DROWS >= 2) {
+ msg = drv_hello (2, DCOLS);
+ if (msg != NULL) {
+ drv_HD_write (1, (DCOLS-strlen(msg))/2, msg, strlen(msg));
+ flag = 1;
+ }
+ }
+
+ if (DROWS >= 3) {
+ qprintf(buffer, sizeof(buffer), "HD44780 %dx%d", DCOLS, DROWS);
+ msg = buffer;
+ if (strlen(msg) <= DCOLS) {
+ drv_HD_write (2, (DCOLS-strlen(msg))/2, msg, strlen(msg));
+ flag = 1;
+ }
+ }
+
+ if (flag && start_stop) {
+ sleep (3);
+ drv_HD_command (allControllers, 0x01, T_CLEAR); // clear *both* displays
+ }
+
+ return 0;
+}
+
+
// close driver & display
int drv_HD_quit (void) {
diff --git a/drv_Image.c b/drv_Image.c
index 82f4e9a..ab9a83b 100644
--- a/drv_Image.c
+++ b/drv_Image.c
@@ -1,4 +1,4 @@
-/* $Id: drv_Image.c,v 1.3 2004/05/31 06:24:42 reinelt Exp $
+/* $Id: drv_Image.c,v 1.4 2004/06/02 09:41:19 reinelt Exp $
*
* new style Image (PPM/PNG) Driver for LCD4Linux
*
@@ -23,6 +23,10 @@
*
*
* $Log: drv_Image.c,v $
+ * Revision 1.4 2004/06/02 09:41:19 reinelt
+ *
+ * prepared support for startup splash screen
+ *
* Revision 1.3 2004/05/31 06:24:42 reinelt
*
* fixed symlink security issue with the image driver
@@ -472,7 +476,7 @@ int drv_IMG_list (void)
// initialize driver & display
-int drv_IMG_init (char *section)
+int drv_IMG_init (char *section, int quiet)
{
WIDGET_CLASS wc;
int ret;
diff --git a/drv_M50530.c b/drv_M50530.c
index 4d903c1..018862c 100644
--- a/drv_M50530.c
+++ b/drv_M50530.c
@@ -1,4 +1,4 @@
-/* $Id: drv_M50530.c,v 1.7 2004/06/01 06:45:29 reinelt Exp $
+/* $Id: drv_M50530.c,v 1.8 2004/06/02 09:41:19 reinelt Exp $
*
* new style driver for M50530-based displays
*
@@ -23,6 +23,10 @@
*
*
* $Log: drv_M50530.c,v $
+ * Revision 1.8 2004/06/02 09:41:19 reinelt
+ *
+ * prepared support for startup splash screen
+ *
* Revision 1.7 2004/06/01 06:45:29 reinelt
*
* some Fixme's processed
@@ -296,7 +300,7 @@ int drv_M5_list (void)
// initialize driver & display
-int drv_M5_init (char *section)
+int drv_M5_init (char *section, int quiet)
{
WIDGET_CLASS wc;
int ret;
diff --git a/drv_MatrixOrbital.c b/drv_MatrixOrbital.c
index ee09de0..26ef3a6 100644
--- a/drv_MatrixOrbital.c
+++ b/drv_MatrixOrbital.c
@@ -1,4 +1,4 @@
-/* $Id: drv_MatrixOrbital.c,v 1.28 2004/06/01 06:45:29 reinelt Exp $
+/* $Id: drv_MatrixOrbital.c,v 1.29 2004/06/02 09:41:19 reinelt Exp $
*
* new style driver for Matrix Orbital serial display modules
*
@@ -23,6 +23,10 @@
*
*
* $Log: drv_MatrixOrbital.c,v $
+ * Revision 1.29 2004/06/02 09:41:19 reinelt
+ *
+ * prepared support for startup splash screen
+ *
* Revision 1.28 2004/06/01 06:45:29 reinelt
*
* some Fixme's processed
@@ -614,7 +618,7 @@ int drv_MO_list (void)
// initialize driver & display
-int drv_MO_init (char *section)
+int drv_MO_init (char *section, int quiet)
{
WIDGET_CLASS wc;
int ret;
diff --git a/drv_MilfordInstruments.c b/drv_MilfordInstruments.c
index d68f3eb..32b29ab 100644
--- a/drv_MilfordInstruments.c
+++ b/drv_MilfordInstruments.c
@@ -1,4 +1,4 @@
-/* $Id: drv_MilfordInstruments.c,v 1.5 2004/05/31 05:38:02 reinelt Exp $
+/* $Id: drv_MilfordInstruments.c,v 1.6 2004/06/02 09:41:19 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.6 2004/06/02 09:41:19 reinelt
+ *
+ * prepared support for startup splash screen
+ *
* Revision 1.5 2004/05/31 05:38:02 reinelt
*
* fixed possible bugs with user-defined chars (clear high bits)
@@ -196,7 +200,7 @@ int drv_MI_list (void)
// initialize driver & display
-int drv_MI_init (char *section)
+int drv_MI_init (char *section, int quiet)
{
WIDGET_CLASS wc;
int ret;
diff --git a/drv_NULL.c b/drv_NULL.c
index 4db7bb0..4e6be5d 100644
--- a/drv_NULL.c
+++ b/drv_NULL.c
@@ -1,4 +1,4 @@
-/* $Id: drv_NULL.c,v 1.1 2004/05/31 16:39:06 reinelt Exp $
+/* $Id: drv_NULL.c,v 1.2 2004/06/02 09:41:19 reinelt Exp $
*
* NULL driver (for testing)
*
@@ -23,6 +23,10 @@
*
*
* $Log: drv_NULL.c,v $
+ * Revision 1.2 2004/06/02 09:41:19 reinelt
+ *
+ * prepared support for startup splash screen
+ *
* Revision 1.1 2004/05/31 16:39:06 reinelt
*
* added NULL display driver (for debugging/profiling purposes)
@@ -124,7 +128,7 @@ int drv_NULL_list (void)
// initialize driver & display
-int drv_NULL_init (char *section)
+int drv_NULL_init (char *section, int quiet)
{
WIDGET_CLASS wc;
int ret;
diff --git a/drv_T6963.c b/drv_T6963.c
index 151cfe9..fc74475 100644
--- a/drv_T6963.c
+++ b/drv_T6963.c
@@ -1,4 +1,4 @@
-/* $Id: drv_T6963.c,v 1.5 2004/06/01 06:45:30 reinelt Exp $
+/* $Id: drv_T6963.c,v 1.6 2004/06/02 09:41:19 reinelt Exp $
*
* new style driver for T6963-based displays
*
@@ -23,6 +23,10 @@
*
*
* $Log: drv_T6963.c,v $
+ * Revision 1.6 2004/06/02 09:41:19 reinelt
+ *
+ * prepared support for startup splash screen
+ *
* Revision 1.5 2004/06/01 06:45:30 reinelt
*
* some Fixme's processed
@@ -512,7 +516,7 @@ int drv_T6_list (void)
// initialize driver & display
-int drv_T6_init (char *section)
+int drv_T6_init (char *section, int quiet)
{
WIDGET_CLASS wc;
int ret;
diff --git a/drv_USBLCD.c b/drv_USBLCD.c
index 17c2cd2..a185e13 100644
--- a/drv_USBLCD.c
+++ b/drv_USBLCD.c
@@ -1,4 +1,4 @@
-/* $Id: drv_USBLCD.c,v 1.5 2004/05/31 05:38:02 reinelt Exp $
+/* $Id: drv_USBLCD.c,v 1.6 2004/06/02 09:41:19 reinelt Exp $
*
* new style driver for USBLCD displays
*
@@ -26,6 +26,10 @@
*
*
* $Log: drv_USBLCD.c,v $
+ * Revision 1.6 2004/06/02 09:41:19 reinelt
+ *
+ * prepared support for startup splash screen
+ *
* Revision 1.5 2004/05/31 05:38:02 reinelt
*
* fixed possible bugs with user-defined chars (clear high bits)
@@ -289,7 +293,7 @@ int drv_UL_list (void)
// initialize driver & display
-int drv_UL_init (char *section)
+int drv_UL_init (char *section, int quiet)
{
WIDGET_CLASS wc;
int asc255bug;
diff --git a/drv_X11.c b/drv_X11.c
index a5c9176..69256c7 100644
--- a/drv_X11.c
+++ b/drv_X11.c
@@ -1,4 +1,4 @@
-/* $Id: drv_X11.c,v 1.2 2004/05/25 14:26:29 reinelt Exp $
+/* $Id: drv_X11.c,v 1.3 2004/06/02 09:41:19 reinelt Exp $
*
* new style X11 Driver for LCD4Linux
*
@@ -26,6 +26,10 @@
*
*
* $Log: drv_X11.c,v $
+ * Revision 1.3 2004/06/02 09:41:19 reinelt
+ *
+ * prepared support for startup splash screen
+ *
* Revision 1.2 2004/05/25 14:26:29 reinelt
*
* added "Image" driver (was: Raster.c) for PPM and PNG creation
@@ -337,7 +341,7 @@ int drv_X11_list (void)
// initialize driver & display
-int drv_X11_init (char *section)
+int drv_X11_init (char *section, int quiet)
{
WIDGET_CLASS wc;
int ret;
diff --git a/layout.c b/layout.c
index 312e1ef..c60a4ff 100644
--- a/layout.c
+++ b/layout.c
@@ -1,4 +1,4 @@
-/* $Id: layout.c,v 1.10 2004/03/03 03:47:04 reinelt Exp $
+/* $Id: layout.c,v 1.11 2004/06/02 09:41:19 reinelt Exp $
*
* new layouter framework
*
@@ -23,6 +23,10 @@
*
*
* $Log: layout.c,v $
+ * Revision 1.11 2004/06/02 09:41:19 reinelt
+ *
+ * prepared support for startup splash screen
+ *
* Revision 1.10 2004/03/03 03:47:04 reinelt
* big patch from Martin Hejl:
* - use qprintf() where appropriate
@@ -134,7 +138,7 @@ int layout_init (char *layout)
if (widget!=NULL && *widget!='\0') {
layout_addItem (widget, row, col);
}
- free(widget);
+ free(widget);
}
// next field
l=p?p+1:NULL;
diff --git a/lcd4linux.c b/lcd4linux.c
index 20c6ed7..857100e 100644
--- a/lcd4linux.c
+++ b/lcd4linux.c
@@ -1,4 +1,4 @@
-/* $Id: lcd4linux.c,v 1.70 2004/06/02 05:14:16 reinelt Exp $
+/* $Id: lcd4linux.c,v 1.71 2004/06/02 09:41:19 reinelt Exp $
*
* LCD4Linux
*
@@ -23,6 +23,10 @@
*
*
* $Log: lcd4linux.c,v $
+ * Revision 1.71 2004/06/02 09:41:19 reinelt
+ *
+ * prepared support for startup splash screen
+ *
* Revision 1.70 2004/06/02 05:14:16 reinelt
*
* fixed models listing for Beckmann+Egle driver
@@ -383,46 +387,6 @@ static void usage(void)
printf (" lcd4linux [-c key=value] [-F] [-f config-file] [-o output-file] [-q] [-v]\n");
}
-#if 0
-// Fixme: how to hello() with new layout?
-int hello (void)
-{
- int i, x, y, flag;
- char *line1[] = { "* LCD4Linux " VERSION " *",
- "LCD4Linux " VERSION,
- "LCD4Linux",
- "L4Linux",
- NULL };
-
- char *line2[] = { "(c) 2003 M.Reinelt",
- "(c) M.Reinelt",
- NULL };
-
- lcd_query (&y, &x, NULL, NULL, NULL, NULL, NULL);
-
- flag=0;
- for (i=0; line1[i]; i++) {
- if (strlen(line1[i])<=x) {
- lcd_put (1, (x-strlen(line1[i]))/2+1, line1[i]);
- flag=1;
- break;
- }
- }
-
- for (i=0; line2[i]; i++) {
- if (strlen(line2[i])<=x) {
- lcd_put (2, (x-strlen(line2[i]))/2+1, line2[i]);
- flag=1;
- break;
- }
- }
-
- if (flag) lcd_flush();
- return flag;
-}
-#endif
-
-
static void interactive_mode (void)
{
char line[1024];
@@ -596,7 +560,7 @@ int main (int argc, char *argv[])
// create PID file
if ((pid = pid_init(PIDFILE)) != 0) {
- error ("lcd4linux already running as process %d", pid)
+ error ("lcd4linux already running as process %d", pid);
exit (1);
}
@@ -612,23 +576,18 @@ int main (int argc, char *argv[])
exit (0);
}
+ // check the conf to see if quiet startup is wanted
+ if (!quiet) {
+ cfg_number(NULL, "Quiet", 0, 0, 1, &quiet);
+ }
+
debug ("initializing driver %s", driver);
- if (drv_init(section, driver)==-1) {
+ if (drv_init(section, driver, quiet)==-1) {
pid_exit(PIDFILE);
exit (1);
}
free(driver);
- // check for new-style layout
- layout=cfg_get(NULL, "Layout", NULL);
- if (layout==NULL || *layout=='\0') {
- error ("missing 'Layout' entry in %s!", cfg_source());
- exit (1);
- }
-
- layout_init(layout);
- free(layout);
-
// go into interactive mode (display has been initialized)
if (interactive >= 1) {
interactive_mode();
@@ -638,18 +597,15 @@ int main (int argc, char *argv[])
exit (0);
}
- // check the conf to see if quiet startup is wanted
- if (!quiet) {
- cfg_number(NULL, "Quiet", 0, 0, 1, &quiet);
+ // check for new-style layout
+ layout=cfg_get(NULL, "Layout", NULL);
+ if (layout==NULL || *layout=='\0') {
+ error ("missing 'Layout' entry in %s!", cfg_source());
+ exit (1);
}
-#if 0
- // Fixme: how to hello() with new layout?
- if (!quiet && hello()) {
- sleep (3);
- lcd_clear(1);
- }
-#endif
+ layout_init(layout);
+ free(layout);
debug ("starting main loop");
@@ -667,11 +623,6 @@ int main (int argc, char *argv[])
debug ("leaving main loop");
-#if 0
- // Fixme: how to hello() with new layout?
- lcd_clear(1);
- if (!quiet) hello();
-#endif
drv_quit();
pid_exit(PIDFILE);
cfg_exit();
diff --git a/lcd4linux.conf.sample b/lcd4linux.conf.sample
index c8ef7ed..1892354 100644
--- a/lcd4linux.conf.sample
+++ b/lcd4linux.conf.sample
@@ -544,7 +544,7 @@ Layout testMySQL {
#Display 'LK204'
#Display 'MI240'
#Display 'CW12232'
-#Display 'HD44780-20x4'
+Display 'HD44780-20x4'
#Display 'M50530-24x8'
#Display 'CF631'
#Display 'CF632'
@@ -553,11 +553,11 @@ Layout testMySQL {
#Display 'USBLCD'
#Display 'T6963-240x64'
#Display 'XWindow'
-Display 'Image'
+#Display 'Image'
-#Layout 'Default'
+Layout 'Default'
#Layout 'L16x2'
-Layout 'L20x2'
+#Layout 'L20x2'
#Layout 'Test'