LCDproc development and user support list

Text archives Help


[Lcdproc] patch for CwLnx display corruption


Chronological Thread 
  • From: gideon.tsang AT cwlinux.com (Gideon)
  • Subject: [Lcdproc] patch for CwLnx display corruption
  • Date: Wed May 9 09:46:01 2007

Hi all,

The CwLnx driver displays corrupted data since v0.5.x. The display has problem handing the data if a string of characters is sent at once. Attached is the patch against v0.5.2.

BR,

Gideon Tsang
diff -ru -xCVS -x'.#*' -x'*.so' -x'*~' -x'*conf*' -x'*.P*' -x'Makefile*' lcdproc-0.5.2.orig/server/drivers/CwLnx.c lcdproc-0.5.2/server/drivers/CwLnx.c
--- lcdproc-0.5.2.orig/server/drivers/CwLnx.c	2007-04-14 22:38:14.000000000 +0800
+++ lcdproc-0.5.2/server/drivers/CwLnx.c	2007-05-09 17:09:44.000000000 +0800
@@ -153,17 +153,17 @@
 
 static int Write_LCD(int fd, char *c, int size)
 {
-    int rc;
+    int rc, i;
     int retries = 30;
 
-    do {
-	rc = write(fd, c, size);
-        if (rc == size)
-	    break;
-	usleep(DELAY);
-        
-    } while (--retries > 0);
-
+    for (i = 0; i < size; i++) {
+        do {
+            rc = write(fd, &c[i], 1);
+            if (rc == 1)
+            break;
+        usleep(DELAY);
+        } while (--retries > 0);
+    }
     return rc;
 }



Archive powered by MHonArc 2.6.18.

Top of page