-/* $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
*
* 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
*
{
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);
}
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;
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;
}
}
-/* $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
*
*
*
* $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
*
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;
}
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;
}
-/* $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
*
*
*
* $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
*
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) {
-/* $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
*
*
*
* $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
*
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);
}