fixes to the CwLnx driver (Gideon Tsang)

This commit is contained in:
marschap
2007-01-16 16:58:35 +00:00
parent a57d8d05f3
commit ab4c51a1d1
3 changed files with 19 additions and 22 deletions
+1
View File
@@ -26,6 +26,7 @@ v.0.5dev (ongoing development)
* update & fix serialVFD driver (Stefan Herdler)
+ Hitachi SP14Q002 support & ConnectionType setting for sed1330 (Benjamin Wiedmann)
* replace obsolete index() by strchr() (Guillaume LECERF)
* fixes for CwLinux driver (Gideon Tsang)
v.0.5.1
+ config file support in lcdproc client (Andrew Foss)
+1
View File
@@ -241,6 +241,7 @@ UseACS=no
# Select the LCD model [default: 12232; legal: 12232, 1602]
Model=12232
# Select the output device to use [default: /dev/lcd]
Device=/dev/ttyUSB0
+17 -22
View File
@@ -6,7 +6,7 @@
Copyright (C) 2002, Andrew Ip
2003, David Glaude
2006, Peter Marschall
2006,7 Peter Marschall
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -145,31 +145,25 @@ static void CwLnx_hidecursor(int fd);
#define LCD_PUT_PIXEL 112
#define LCD_CLEAR_PIXEL 113
#define DELAY 20
#define UPDATE_DELAY 0 /* 1 sec */
#define SETUP_DELAY 1 /* 2 sec */
#define DELAY 2000 /* 2 milli sec */
#define UPDATE_DELAY 0 /* 1 imicro sec */
#define SETUP_DELAY 1 /* 2 micro sec */
static int Write_LCD(int fd, char *c, int size)
{
int rc;
int retries = 30;
do {
rc = write(fd, c, size);
if (rc == size)
break;
usleep(DELAY);
} while (--retries > 0);
rc = write(fd, c, size);
/* Debuging code to be cleaned when very stable */
/*
if (size == 1) {
if (*c >= 0)
printf("%3d ", *c);
else {
if (*c+256==254)
printf("\n%3d ", *c+256);
else
printf("%3d ", *c+256);
}
}
*/
/* usleep(DELAY); */
return rc;
}
@@ -1095,8 +1089,7 @@ CwLnx_set_char(Driver *drvthis, int n, unsigned char *dat)
c = dat[row] & mask;
Write_LCD(p->fd, &c, 1);
}
}
else { // the graphical model
} else if (p->model == 12232) { // the graphical model
int col;
for (col = p->cellwidth - 1; col >= 0; col--) {
@@ -1108,7 +1101,9 @@ CwLnx_set_char(Driver *drvthis, int n, unsigned char *dat)
letter |= ((dat[row] >> col) & 1);
}
c = letter;
/* restrict width to 5 pixels */
c = (col < p->cellwidth - 1) ? letter : '\0';
Write_LCD(p->fd, &c, 1);
}
}