From bc0c578f70d4df6ff809471479be6552c6a209b3 Mon Sep 17 00:00:00 2001 From: reinelt <> Date: Tue, 19 Aug 2003 04:28:41 +0000 Subject: [lcd4linux @ 2003-08-19 04:28:41 by reinelt] more Icon stuff, minor glitches fixed --- Crystalfontz.c | 11 +++++++---- HD44780.c | 19 +++++++++++++------ MatrixOrbital.c | 11 ++++++++--- bar.c | 20 ++++++++++++++------ 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; col8) { - 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 && Segment[j].len2RES) 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 && j2