move definitions for symbolicnames to correct palce for dependencies;
allow ConnectionTypes to be case insensitive
This commit is contained in:
@@ -29,30 +29,6 @@
|
|||||||
// add new connection type header files here
|
// 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:
|
// connectionType enumerator:
|
||||||
// - string to identify connection in config file
|
// - string to identify connection in config file
|
||||||
// - connection type identifier
|
// - connection type identifier
|
||||||
|
|||||||
@@ -22,7 +22,30 @@
|
|||||||
# endif
|
# 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
|
// Maximum sizes of the keypad
|
||||||
// DO NOT CHANGE THESE 2 VALUES, unless you change the functions too
|
// DO NOT CHANGE THESE 2 VALUES, unless you change the functions too
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ HD44780_init(Driver *drvthis)
|
|||||||
// Get and search for the connection type
|
// Get and search for the connection type
|
||||||
s = drvthis->config_get_string(drvthis->name, "ConnectionType", 0, "4bit");
|
s = drvthis->config_get_string(drvthis->name, "ConnectionType", 0, "4bit");
|
||||||
for (i = 0; (connectionMapping[i].name != NULL) &&
|
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) {
|
if (connectionMapping[i].name == NULL) {
|
||||||
report(RPT_ERR, "%s: unknown ConnectionType: %s", drvthis->name, s);
|
report(RPT_ERR, "%s: unknown ConnectionType: %s", drvthis->name, s);
|
||||||
return -1; // fatal error
|
return -1; // fatal error
|
||||||
@@ -176,6 +176,8 @@ HD44780_init(Driver *drvthis)
|
|||||||
/* set connection type */
|
/* set connection type */
|
||||||
p->connectiontype = connectionMapping[i].connectiontype;
|
p->connectiontype = connectionMapping[i].connectiontype;
|
||||||
|
|
||||||
|
report(RPT_INFO,"HD44780: using ConnectionType: %s", connectionMapping[i].name);
|
||||||
|
|
||||||
if_type = connectionMapping[i].if_type;
|
if_type = connectionMapping[i].if_type;
|
||||||
init_fn = connectionMapping[i].init_fn;
|
init_fn = connectionMapping[i].init_fn;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user