]> git.webhop.me Git - lcd4linux.git/commitdiff
[lcd4linux @ 2003-08-19 04:28:41 by reinelt]
authorreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Tue, 19 Aug 2003 04:28:41 +0000 (04:28 +0000)
committerreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Tue, 19 Aug 2003 04:28:41 +0000 (04:28 +0000)
more Icon stuff, minor glitches fixed

git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@223 3ae390bd-cb1e-0410-b409-cd5a39f66f1f

Crystalfontz.c
HD44780.c
MatrixOrbital.c
bar.c

index 44792100680215b0a7b82f0fee8abc8bd6cc9e00..628abe06d1218b0cb3ebe4f2be2bb31d61858919 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: Crystalfontz.c,v 1.11 2003/08/17 06:57:04 reinelt Exp $
+/* $Id: Crystalfontz.c,v 1.12 2003/08/19 04:28:41 reinelt Exp $
  *
  * driver for display modules from Crystalfontz
  *
@@ -19,6 +19,9 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
  * $Log: Crystalfontz.c,v $
+ * Revision 1.12  2003/08/19 04:28:41  reinelt
+ * more Icon stuff, minor glitches fixed
+ *
  * Revision 1.11  2003/08/17 06:57:04  reinelt
  * complete rewrite of the Crystalfontz driver
  *
@@ -162,7 +165,7 @@ static void CF_define_char (int ascii, char *buffer)
 {
   char cmd[3]="031"; // set custom char bitmap
 
-  cmd[1]=(char)ascii;
+  cmd[1]=128+(char)ascii;
   CF_write (cmd, 2);
   CF_write (buffer, 8);
 }
@@ -176,8 +179,7 @@ static int CF_clear (int full)
   
   if (full) {
     memset (FrameBuffer2, ' ', Lcd.rows*Lcd.cols*sizeof(char));
-    // Fixme: is there a "clear screen" command?
-    // CF_write ("\000", 1);  // Clear Screen
+    CF_write ("\014", 1);  // Form Feed (Clear Display)
   }
   
   return 0;
@@ -299,6 +301,7 @@ static int CF_flush (void)
     for (col=0; col<Lcd.cols; col++) {
       c=bar_peek(row, col);
       if (c!=-1) {
+       if (c!=32) c+=128; //blank
        FrameBuffer1[row*Lcd.cols+col]=(char)c;
       }
     }
index 496f922636a1d1dc03027b395444837c1c5cbcc8..babc11a0bde6ade0ccc9ada605022082d457bcce 100644 (file)
--- a/HD44780.c
+++ b/HD44780.c
@@ -1,4 +1,4 @@
-/* $Id: HD44780.c,v 1.32 2003/08/16 07:31:35 reinelt Exp $
+/* $Id: HD44780.c,v 1.33 2003/08/19 04:28:41 reinelt Exp $
  *
  * driver for display modules based on the HD44780 chip
  *
@@ -24,6 +24,9 @@
  *
  *
  * $Log: HD44780.c,v $
+ * Revision 1.33  2003/08/19 04:28:41  reinelt
+ * more Icon stuff, minor glitches fixed
+ *
  * Revision 1.32  2003/08/16 07:31:35  reinelt
  * double buffering in all drivers
  *
@@ -372,10 +375,13 @@ int HD_init (LCD *Self)
   if (s==NULL) {
     gpos=0;
   }
-  else if ((gpos=strtol(s, &e, 0))==0 || *e!='\0' || gpos<0 || gpos>8) {
-    error ("HD44780: bad GPOs '%s' in %s", s, cfg_file());
-    return -1;
-  }    
+  else {
+    gpos=strtol(s, &e, 0);
+    if (*e!='\0' || gpos<0 || gpos>8) {
+      error ("HD44780: bad GPOs '%s' in %s", s, cfg_file());
+      return -1;
+    }    
+  }
   
   Self->rows=rows;
   Self->cols=cols;
@@ -391,7 +397,8 @@ int HD_init (LCD *Self)
   }
 
   s=cfg_get("Bits", "8");
-  if ((Bits=strtol(s, &e, 0))==0 || *e!='\0' || (Bits!=4 && Bits!=8)) {
+  Bits=strtol(s, &e, 0);
+  if (*e!='\0' || (Bits!=4 && Bits!=8)) {
     error ("HD44780: bad Bits '%s' in %s, should be '4' or '8'", s, cfg_file());
     return -1;
   }    
index a900b27c0f2452dfdcf6f912895c74836fea9617..68198b349a644d327aa4e191400d477586b8f491 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: MatrixOrbital.c,v 1.30 2003/08/17 16:37:39 reinelt Exp $
+/* $Id: MatrixOrbital.c,v 1.31 2003/08/19 04:28:41 reinelt Exp $
  *
  * driver for Matrix Orbital serial display modules
  *
@@ -20,6 +20,9 @@
  *
  *
  * $Log: MatrixOrbital.c,v $
+ * Revision 1.31  2003/08/19 04:28:41  reinelt
+ * more Icon stuff, minor glitches fixed
+ *
  * Revision 1.30  2003/08/17 16:37:39  reinelt
  * more icon framework
  *
@@ -346,8 +349,10 @@ static int MO_init (LCD *Self, int protocol)
   if (Device==-1) return -1;
 
   s=cfg_get("Icons", "0");
-  if ((Icons=strtol(s, &e, 0))==0 || *e!='\0' || (Icons<0 && Icons>8)) {
-    error ("MatrixOrbital: bad Iconss '%s' in %s, must be between 0 and 8", s, cfg_file());
+  Icons=strtol(s, &e, 0);
+  if (*e!='\0' || Icons<0 || Icons>8) {
+    debug ("Icons=%d e=<%s>", Icons, e);
+    error ("MatrixOrbital: bad Icons '%s' in %s, must be between 0 and 8", s, cfg_file());
     return -1;
   }    
   if (Icons>0) {
diff --git a/bar.c b/bar.c
index ff65673972fa8fe73b3a11dd31ffe50628ad6da9..3d6e3c452c0d719ccb8cf046732b9eaf1351fcfc 100644 (file)
--- a/bar.c
+++ b/bar.c
@@ -1,4 +1,4 @@
-/* $Id: bar.c,v 1.4 2003/01/12 06:51:27 reinelt Exp $
+/* $Id: bar.c,v 1.5 2003/08/19 04:28:41 reinelt Exp $
  *
  * generic bar handling
  *
@@ -20,6 +20,9 @@
  *
  *
  * $Log: bar.c,v $
+ * Revision 1.5  2003/08/19 04:28:41  reinelt
+ * more Icon stuff, minor glitches fixed
+ *
  * Revision 1.4  2003/01/12 06:51:27  reinelt
  * fixed bug in bar compaction
  *
@@ -241,18 +244,23 @@ static int segment_deviation (int i, int j)
   
   if (i==j) return 65535;
   if (!(Segment[i].type & Segment[j].type)) return 65535;
-  if (Segment[i].len1==0 && Segment[j].len1!=0) return 65535;
-  if (Segment[i].len2==0 && Segment[j].len2!=0) return 65535;
+
   RES=Segment[i].type & BAR_H ? XRES:YRES;
-  if (Segment[i].len1>=RES && Segment[j].len1<RES) return 65535;
-  if (Segment[i].len2>=RES && Segment[j].len2<RES) return 65535;
-  if (Segment[i].len1==Segment[i].len2 && Segment[j].len1!=Segment[j].len2) return 65535;
 
   i1=Segment[i].len1; if (i1>RES) i1=RES;
   i2=Segment[i].len2; if (i2>RES) i2=RES;
   j1=Segment[j].len1; if (j1>RES) i1=RES;
   j2=Segment[j].len2; if (j2>RES) i2=RES;
   
+  if (i1==0   && j1!=0)  return 65535;
+  if (i2==0   && j2!=0)  return 65535;
+  if (i1>=RES && j1<RES) return 65535;
+  if (i2>=RES && j2<RES) return 65535;
+  if (i1==i2  && j1!=j2) return 65535;
+
+  if (i1==1   && j1==0)  return 65535;
+  if (i2==1   && j2==0)  return 65535;
+  
   return (i1-j1)*(i1-j1)+(i2-j2)*(i2-j2);
 }