fixes to the CwLnx driver (Gideon Tsang)
This commit is contained in:
@@ -26,6 +26,7 @@ v.0.5dev (ongoing development)
|
|||||||
* update & fix serialVFD driver (Stefan Herdler)
|
* update & fix serialVFD driver (Stefan Herdler)
|
||||||
+ Hitachi SP14Q002 support & ConnectionType setting for sed1330 (Benjamin Wiedmann)
|
+ Hitachi SP14Q002 support & ConnectionType setting for sed1330 (Benjamin Wiedmann)
|
||||||
* replace obsolete index() by strchr() (Guillaume LECERF)
|
* replace obsolete index() by strchr() (Guillaume LECERF)
|
||||||
|
* fixes for CwLinux driver (Gideon Tsang)
|
||||||
|
|
||||||
v.0.5.1
|
v.0.5.1
|
||||||
+ config file support in lcdproc client (Andrew Foss)
|
+ config file support in lcdproc client (Andrew Foss)
|
||||||
|
|||||||
@@ -241,6 +241,7 @@ UseACS=no
|
|||||||
|
|
||||||
# Select the LCD model [default: 12232; legal: 12232, 1602]
|
# Select the LCD model [default: 12232; legal: 12232, 1602]
|
||||||
Model=12232
|
Model=12232
|
||||||
|
|
||||||
# Select the output device to use [default: /dev/lcd]
|
# Select the output device to use [default: /dev/lcd]
|
||||||
Device=/dev/ttyUSB0
|
Device=/dev/ttyUSB0
|
||||||
|
|
||||||
|
|||||||
+16
-21
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
Copyright (C) 2002, Andrew Ip
|
Copyright (C) 2002, Andrew Ip
|
||||||
2003, David Glaude
|
2003, David Glaude
|
||||||
2006, Peter Marschall
|
2006,7 Peter Marschall
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
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
|
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_PUT_PIXEL 112
|
||||||
#define LCD_CLEAR_PIXEL 113
|
#define LCD_CLEAR_PIXEL 113
|
||||||
|
|
||||||
#define DELAY 20
|
#define DELAY 2000 /* 2 milli sec */
|
||||||
#define UPDATE_DELAY 0 /* 1 sec */
|
#define UPDATE_DELAY 0 /* 1 imicro sec */
|
||||||
#define SETUP_DELAY 1 /* 2 sec */
|
#define SETUP_DELAY 1 /* 2 micro sec */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static int Write_LCD(int fd, char *c, int size)
|
static int Write_LCD(int fd, char *c, int size)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
|
int retries = 30;
|
||||||
|
|
||||||
|
do {
|
||||||
rc = write(fd, c, size);
|
rc = write(fd, c, size);
|
||||||
/* Debuging code to be cleaned when very stable */
|
if (rc == size)
|
||||||
/*
|
break;
|
||||||
if (size == 1) {
|
usleep(DELAY);
|
||||||
if (*c >= 0)
|
|
||||||
printf("%3d ", *c);
|
} while (--retries > 0);
|
||||||
else {
|
|
||||||
if (*c+256==254)
|
|
||||||
printf("\n%3d ", *c+256);
|
|
||||||
else
|
|
||||||
printf("%3d ", *c+256);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
/* usleep(DELAY); */
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1095,8 +1089,7 @@ CwLnx_set_char(Driver *drvthis, int n, unsigned char *dat)
|
|||||||
c = dat[row] & mask;
|
c = dat[row] & mask;
|
||||||
Write_LCD(p->fd, &c, 1);
|
Write_LCD(p->fd, &c, 1);
|
||||||
}
|
}
|
||||||
}
|
} else if (p->model == 12232) { // the graphical model
|
||||||
else { // the graphical model
|
|
||||||
int col;
|
int col;
|
||||||
|
|
||||||
for (col = p->cellwidth - 1; col >= 0; 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);
|
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);
|
Write_LCD(p->fd, &c, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user