aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--Crystalfontz.c11
-rw-r--r--HD44780.c19
-rw-r--r--MatrixOrbital.c11
-rw-r--r--bar.c20
4 files changed, 42 insertions, 19 deletions
diff --git a/Crystalfontz.c b/Crystalfontz.c
index 4479210..628abe0 100644
--- a/Crystalfontz.c
+++ b/Crystalfontz.c
@@ -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;
}
}
diff --git a/HD44780.c b/HD44780.c
index 496f922..babc11a 100644
--- 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;
}
diff --git a/MatrixOrbital.c b/MatrixOrbital.c
index a900b27..68198b3 100644
--- a/MatrixOrbital.c
+++ b/MatrixOrbital.c
@@ -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 ff65673..3d6e3c4 100644
--- 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);
}