[Lcdproc] [Lcdproc][patch] Cwlnx driver bug fix
Peter Marschall
peter@adpm.de
Wed Jan 17 13:07:02 2007
Hi,
On Wednesday, 17. January 2007 10:40, Gideon wrote:
> The bars only write the whole block correctly, but not partially. It
> looks something like this
>
>
> ******
> ******
> ***** *****
> ***** *****
> ***** *****
> ***** *****
> ***** *****
> ***** *****
> ***** *****
> ***** *****
O.K. thanks for the info.
I guess you are right. we need to zero the 6'th column.
> I also tried the nightly tarball(20070117). It is somewhat different
> from the stable-0-5-x version which I was using. The LCDd of this
> version didn't run successfully. It gave me this following error:
>
> "Could not open driver module server/drivers/CwLnx.so:
> server/drivers/CwLnx.so: undefined symbol: lib_adv_bignum"
This man an omission of mine in server/drivers/Makefile.am
I committed a fix to CVS that will be in tonight's (=tomorrow's) tar ball.
If you use CVS directly, you may download the latest Makefile.am
with the fixed line:
CwLnx_LDADD = libLCD.a libbignum.a
and regenerate all the Makefile.in's by calling
sh ./autogen.sh
in the base source directory.
> and even I commented it out the screen doesn't draw correct, I'm still
> looking at it now.
Hmmm, the only changes between the two versions are
- a few comment changes
- a change to CwLnx_num() to use the bignum library.
(only used in the bigClock screen)
- the patch you sent to me
(I changed it a bit: removed the debugging fprintf(), ...)
- a few optimzations for the static functions I wrote yesterday
(and which I wanted you to test ;)
These changes are supposed to do one write operation to the
device for each command instead of one write per byte.
Of these the only "critical" might be my changes.
But the look pretty straightforward:
@@ -183,94 +177,58 @@
/* Hardware function */
static void Enable_Backlight(int fd)
{
- char c;
- int rc;
+ char cmd[] = { LCD_CMD, LCD_LIGHT_ON, LCD_CMD_END };
- c = LCD_CMD;
- rc = Write_LCD(fd, &c, 1);
- c = LCD_LIGHT_ON;
- rc = Write_LCD(fd, &c, 1);
- c = LCD_CMD_END;
- rc = Write_LCD(fd, &c, 1);
+ Write_LCD(fd, cmd, 3);
}
I.e. they change:
static void Enable_Backlight(int fd)
{
char c;
int rc;
c = LCD_CMD;
rc = Write_LCD(fd, &c, 1);
c = LCD_LIGHT_ON;
rc = Write_LCD(fd, &c, 1);
c = LCD_CMD_END;
rc = Write_LCD(fd, &c, 1);
}
to
static void Enable_Backlight(int fd)
{
char cmd[] = { LCD_CMD, LCD_LIGHT_ON, LCD_CMD_END };
Write_LCD(fd, cmd, 3);
}
Re-checking the changes, I found one error in them, which I immediately fixed.
> BTW, I just noticed that the instruction of getting the latest version
> of LCDproc from CVS is incorrect in this page:
> http://lcdproc.sourceforge.net/docs/current-user.html
Thanks for splitting it: Fixed in CVS
Peter
--
Peter Marschall
peter@adpm.de