move definitions for symbolicnames to correct palce for dependencies;

allow ConnectionTypes to be case insensitive
This commit is contained in:
marschap
2007-10-14 10:42:15 +00:00
parent 0899cef23d
commit 335fc84785
3 changed files with 27 additions and 26 deletions
-24
View File
@@ -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
+24 -1
View File
@@ -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
+3 -1
View File
@@ -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;
}