diff --git a/LCDd.conf b/LCDd.conf index f8cac46..c4ac026 100644 --- a/LCDd.conf +++ b/LCDd.conf @@ -287,6 +287,10 @@ Outputport=no # If you have the additional output port ("bargraph") and you want to # be able to control it with the lcdproc OUTPUT command +#Lastline=true +# Specifies if the last line is pixel addressable or it controls an +# underline effect. Default: true (pixel addressable) + Size=20x4 # Specifies the size of the LCD. # In case of multiple combined displays, this should be the total size. @@ -334,6 +338,10 @@ Size=20x4 # (if not given, the 1st IOWarrior found gets used) #SerialNumber=00000674 +# Specifies if the last line is pixel addressable or it controls an +# underline effect. Default: true (pixel addressable) +#Lastline=true + [IrMan] diff --git a/server/drivers/IOWarrior.c b/server/drivers/IOWarrior.c index 7468c69..e17bbdd 100644 --- a/server/drivers/IOWarrior.c +++ b/server/drivers/IOWarrior.c @@ -263,6 +263,9 @@ PrivateData *p; p->width = w; p->height = h; + /* special option lastline (some displays need it against the underline effect) */ + p->lastline = drvthis->config_get_bool(drvthis->name, "lastline", 0, 1); + /* Contrast of the LCD can be changed by adjusting a trimpot */ /* End of config file parsing */ @@ -1022,6 +1025,9 @@ int row; if (dat == NULL) return; + if (!p->lastline) + dat[(p->cellheight - 1) * p->cellwidth] = 0; + for (row = 0; row < p->cellheight; row++) { int letter = 0; int col; @@ -1106,11 +1112,21 @@ char checkbox_gray[CELLWIDTH*CELLHEIGHT] = { 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 }; +char block_filled[CELLWIDTH*CELLHEIGHT] = { + 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, + 0, 0, 0, 0, 0 }; /* Yes we know, this is a VERY BAD implementation */ switch(icon) { case ICON_BLOCK_FILLED: - IOWarrior_chr(drvthis, x, y, 255); + IOWarrior_set_char(drvthis, 6, block_filled); + IOWarrior_chr(drvthis, x, y, 6); break; case ICON_HEART_FILLED: IOWarrior_set_char(drvthis, 0, heart_filled); diff --git a/server/drivers/IOWarrior.h b/server/drivers/IOWarrior.h index c69e15c..3823061 100644 --- a/server/drivers/IOWarrior.h +++ b/server/drivers/IOWarrior.h @@ -98,6 +98,11 @@ typedef struct driver_private_data { unsigned int output_mask; int output_state; + /* lastline controls the use of the last line, if pixel addressable (true, default) or */ + /* underline effect (false). To avoid the underline effect in the latter case, the last */ + /* line is always zeroed for whatever redefined character */ + char lastline; + int brightness; int backlight; } PrivateData; diff --git a/server/drivers/hd44780-low.h b/server/drivers/hd44780-low.h index 28801ec..ad738d9 100644 --- a/server/drivers/hd44780-low.h +++ b/server/drivers/hd44780-low.h @@ -85,7 +85,10 @@ typedef struct driver_private_data { int delayMult; // Delay multiplier for slow displays char delayBus; // Delay if the computer can send data too fast over // its bus to LPT port - + char lastline; // lastline controls the use of the last line, if pixel addressable (true, default) or + // underline effect (false). To avoid the underline effect, last line is always zeroed + // for whatever redefined character + // keyMapDirect contains an array of the ascii-codes that should be generated // when a directly connected key is pressed (not in matrix). char *keyMapDirect[KEYPAD_MAXX]; diff --git a/server/drivers/hd44780.c b/server/drivers/hd44780.c index 5e0bdcd..8824615 100644 --- a/server/drivers/hd44780.c +++ b/server/drivers/hd44780.c @@ -155,6 +155,7 @@ HD44780_init (Driver * drvthis, char *args) p->have_output = drvthis->config_get_bool( drvthis->name, "outputport", 0, 0 ); p->delayMult = drvthis->config_get_int( drvthis->name, "delaymult", 0, 1 ); p->delayBus = drvthis->config_get_bool( drvthis->name, "delaybus", 0, 1 ); + p->lastline = drvthis->config_get_bool( drvthis->name, "lastline", 0, 1 ); // Get and search for the connection type s = drvthis->config_get_string( drvthis->name, "connectiontype", 0, "4bit" ); @@ -974,6 +975,9 @@ HD44780_set_char (Driver *drvthis, int n, char *dat) if (!dat) return; + if (!p->lastline) + dat[(p->cellheight - 1) * p->cellwidth]=0; + for (row = 0; row < p->cellheight; row++) { letter = 0; for (col = 0; col < p->cellwidth; col++) { @@ -1056,11 +1060,21 @@ HD44780_icon (Driver *drvthis, int x, int y, int icon) 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 }; + char block_filled[] = { + 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, + 0, 0, 0, 0, 0 }; /* Yes I know, this is a VERY BAD implementation */ switch( icon ) { case ICON_BLOCK_FILLED: - HD44780_chr( drvthis, x, y, 255 ); + HD44780_set_char( drvthis, 6, block_filled ); + HD44780_chr( drvthis, x, y, 6); break; case ICON_HEART_FILLED: HD44780_set_char( drvthis, 0, heart_filled );