diff options
author | reinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f> | 2004-05-31 05:38:02 +0000 |
---|---|---|
committer | reinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f> | 2004-05-31 05:38:02 +0000 |
commit | ea5453f570c5186379745a10054280f47a809299 (patch) | |
tree | cdf640e43c8a07c9d79278f5e47aefbd142130e2 /drv_MilfordInstruments.c | |
parent | 0bda5dcd7faa2198fe972aa85b8c72cb0b666554 (diff) | |
download | lcd4linux-ea5453f570c5186379745a10054280f47a809299.tar.gz |
[lcd4linux @ 2004-05-31 05:38:02 by reinelt]
fixed possible bugs with user-defined chars (clear high bits)
thanks to Andy Baxter for debugging the MilfordInstruments driver!
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@449 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
Diffstat (limited to '')
-rw-r--r-- | drv_MilfordInstruments.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/drv_MilfordInstruments.c b/drv_MilfordInstruments.c index 4cbf9be..d68f3eb 100644 --- a/drv_MilfordInstruments.c +++ b/drv_MilfordInstruments.c @@ -1,4 +1,4 @@ -/* $Id: drv_MilfordInstruments.c,v 1.4 2004/05/31 01:31:01 andy-b Exp $ +/* $Id: drv_MilfordInstruments.c,v 1.5 2004/05/31 05:38:02 reinelt Exp $ * * driver for Milford Instruments 'BPK' piggy-back serial interface board * for standard Hitachi 44780 compatible lcd modules. @@ -27,6 +27,11 @@ * * * $Log: drv_MilfordInstruments.c,v $ + * Revision 1.5 2004/05/31 05:38:02 reinelt + * + * fixed possible bugs with user-defined chars (clear high bits) + * thanks to Andy Baxter for debugging the MilfordInstruments driver! + * * Revision 1.4 2004/05/31 01:31:01 andy-b * * @@ -108,17 +113,17 @@ static void drv_MI_write (int row, int col, unsigned char *data, int len) } -static void drv_MI_defchar (int ascii, unsigned char *buffer) +static void drv_MI_defchar (int ascii, unsigned char *matrix) { int i; - char cmd[2]="\376x"; + char cmd[10]="\376x"; + if (ascii<8) { cmd[1]=(char)(64+ascii*8); for ( i=0; i<8; i++) { - buffer[i]&=0x1f; - }; - drv_generic_serial_write (cmd, 2); - drv_generic_serial_write (buffer, 8); + cmd[i+2] = matrix[i] & 0x1f; + }; + drv_generic_serial_write (cmd, 10); } } @@ -144,7 +149,7 @@ static int drv_MI_start (char *section) Model=i; info ("%s: using model '%s'", Name, Models[Model].name); - if (drv_generic_serial_open(section, Name)<0) return -1; + if (drv_generic_serial_open(section, Name, 0) < 0) return -1; // initialize global variables DROWS = Models[Model].rows; @@ -221,7 +226,7 @@ int drv_MI_init (char *section) return ret; // initialize generic bar driver - if ((ret=drv_generic_text_bar_init())!=0) + if ((ret=drv_generic_text_bar_init(0))!=0) return ret; // add fixed chars to the bar driver |