make ConnectionType 4bit more fool-proof (M. Dolze)

This commit is contained in:
marschap
2007-10-08 13:54:05 +00:00
parent 99e11c79bb
commit 5a75b922eb
2 changed files with 5 additions and 3 deletions
+3 -2
View File
@@ -100,7 +100,7 @@ hd_init_4bit(Driver *drvthis)
PrivateData *p = (PrivateData*) drvthis->private_data;
HD44780_functions *hd44780_functions = p->hd44780_functions;
int enableLines = EN1 | EN2 | EN3;
int enableLines = EN1 | EN2 | ((p->numDisplays == 3) ? EnMask[2] : 0);
// Reserve the port registers
port_access_multiple(p->port,3);
@@ -186,7 +186,8 @@ lcdstat_HD44780_senddata(PrivateData *p, unsigned char displayID, unsigned char
if (displayID <= 3) {
if (displayID == 0) {
enableLines = EnMask[0] | EnMask[1] | EnMask[2];
enableLines = EnMask[0] | EnMask[1]
| ((p->numDisplays == 3) ? EnMask[2] : 0);
} else {
enableLines = EnMask[displayID - 1];
}