[Lcdproc] [Lcdproc][patch] Cwlnx driver bug fix

Gideon gideon.tsang@cwlinux.com
Mon Jan 15 04:06:02 2007


This is a multi-part message in MIME format.
--------------050306030105020800010700
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi all,

I pulled out the current 0.5 dev version from CVS, and found that the 
driver for the Cwlinux display writes garbages sometimes and draws 
incorrect vertical bars.  Attached is the patch file to the bug fixes, 
please help to commit it to the CVS.

Best Regards,
Gideon Tsang

--------------050306030105020800010700
Content-Type: text/x-patch;
 name="cwlnx.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="cwlnx.patch"

Only in lcdproc/contrib: AndrewFoss
Only in lcdproc: .cwlinux.patch.swp
Only in lcdproc: debian
Only in lcdproc: old
Only in lcdproc/scripts/debian: manpages
Only in lcdproc/scripts/debian: patches
diff -ru -xCVS -x'.#*' -x'*.so' -x'*~' -x'*conf*' -x'*.P*' -x'Makefile*' lcdproc.orig/server/drivers/CwLnx.c lcdproc/server/drivers/CwLnx.c
--- lcdproc.orig/server/drivers/CwLnx.c	2006-10-07 01:23:21.000000000 +0800
+++ lcdproc/server/drivers/CwLnx.c	2007-01-12 13:06:48.000000000 +0800
@@ -153,9 +153,15 @@
 
 static int Write_LCD(int fd, char *c, int size)
 {
-    int rc;
+    int i, rc;
 
-    rc = write(fd, c, size);
+    for (i = 0;; i++) {
+	rc = write(fd, c, size);
+	if (rc == size) {
+	    break;
+	}
+	usleep(2000);
+    }
 /* Debuging code to be cleaned when very stable */
 /* 
     if (size == 1) {
@@ -965,7 +971,8 @@
 
 	for (i = 1; i < p->cellheight; i++) {
 	    // add pixel line per pixel line ...
-	    vBar[p->cellheight - i] = 0xFF;
+
+            vBar[p->cellheight - i] = 0x1F;		// match the vbar
 	    CwLnx_set_char(drvthis, i+1, vBar);
 	}
     }
Only in lcdproc: tests

--------------050306030105020800010700--