From 335fc84785cbd84d312afa576cf2491ab7a6b5f4 Mon Sep 17 00:00:00 2001 From: marschap Date: Sun, 14 Oct 2007 10:42:15 +0000 Subject: [PATCH] move definitions for symbolicnames to correct palce for dependencies; allow ConnectionTypes to be case insensitive --- server/drivers/hd44780-drivers.h | 24 ------------------------ server/drivers/hd44780-low.h | 25 ++++++++++++++++++++++++- server/drivers/hd44780.c | 4 +++- 3 files changed, 27 insertions(+), 26 deletions(-) diff --git a/server/drivers/hd44780-drivers.h b/server/drivers/hd44780-drivers.h index 8859a39..b55039d 100644 --- a/server/drivers/hd44780-drivers.h +++ b/server/drivers/hd44780-drivers.h @@ -29,30 +29,6 @@ // add new connection type header files here -// symbolic names for connection types -#define HD44780_CT_UNKNOWN 0 -#define HD44780_CT_4BIT 1 -#define HD44780_CT_8BIT 2 -#define HD44780_CT_SERIALLPT 3 -#define HD44780_CT_WINAMP 4 -#define HD44780_CT_PICANLCD 5 -#define HD44780_CT_LCDSERIALIZER 6 -#define HD44780_CT_LOS_PANEL 7 -#define HD44780_CT_VDR_LCD 8 -#define HD44780_CT_VDR_WAKEUP 9 -#define HD44780_CT_PERTELIAN 10 -#define HD44780_CT_LIS2 11 -#define HD44780_CT_BWCTUSB 12 -#define HD44780_CT_LCDUSB 13 -#define HD44780_CT_I2C 14 - -// symbolic names for interface types -#define IF_TYPE_UNKNOWN 0 -#define IF_TYPE_PARPORT 1 -#define IF_TYPE_SERIAL 2 -#define IF_TYPE_USB 3 -#define IF_TYPE_I2C 4 - // connectionType enumerator: // - string to identify connection in config file // - connection type identifier diff --git a/server/drivers/hd44780-low.h b/server/drivers/hd44780-low.h index 80a97da..9026f03 100644 --- a/server/drivers/hd44780-low.h +++ b/server/drivers/hd44780-low.h @@ -22,7 +22,30 @@ # endif -//struct hwDependentFns; +// symbolic names for connection types +#define HD44780_CT_UNKNOWN 0 +#define HD44780_CT_4BIT 1 +#define HD44780_CT_8BIT 2 +#define HD44780_CT_SERIALLPT 3 +#define HD44780_CT_WINAMP 4 +#define HD44780_CT_PICANLCD 5 +#define HD44780_CT_LCDSERIALIZER 6 +#define HD44780_CT_LOS_PANEL 7 +#define HD44780_CT_VDR_LCD 8 +#define HD44780_CT_VDR_WAKEUP 9 +#define HD44780_CT_PERTELIAN 10 +#define HD44780_CT_LIS2 11 +#define HD44780_CT_BWCTUSB 12 +#define HD44780_CT_LCDUSB 13 +#define HD44780_CT_I2C 14 + +// symbolic names for interface types +#define IF_TYPE_UNKNOWN 0 +#define IF_TYPE_PARPORT 1 +#define IF_TYPE_SERIAL 2 +#define IF_TYPE_USB 3 +#define IF_TYPE_I2C 4 + // Maximum sizes of the keypad // DO NOT CHANGE THESE 2 VALUES, unless you change the functions too diff --git a/server/drivers/hd44780.c b/server/drivers/hd44780.c index d58c2bf..4b8f513 100644 --- a/server/drivers/hd44780.c +++ b/server/drivers/hd44780.c @@ -168,7 +168,7 @@ HD44780_init(Driver *drvthis) // Get and search for the connection type s = drvthis->config_get_string(drvthis->name, "ConnectionType", 0, "4bit"); for (i = 0; (connectionMapping[i].name != NULL) && - (strcmp(s, connectionMapping[i].name) != 0); i++); + (strcasecmp(s, connectionMapping[i].name) != 0); i++); if (connectionMapping[i].name == NULL) { report(RPT_ERR, "%s: unknown ConnectionType: %s", drvthis->name, s); return -1; // fatal error @@ -176,6 +176,8 @@ HD44780_init(Driver *drvthis) /* set connection type */ p->connectiontype = connectionMapping[i].connectiontype; + report(RPT_INFO,"HD44780: using ConnectionType: %s", connectionMapping[i].name); + if_type = connectionMapping[i].if_type; init_fn = connectionMapping[i].init_fn; }