aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--MatrixOrbital.c9
-rw-r--r--Raster.c18
-rw-r--r--Skeleton.c9
-rw-r--r--XWindow.c9
-rw-r--r--display.c17
-rw-r--r--display.h11
-rw-r--r--fontmap.c15
-rw-r--r--lcd4linux.c17
-rw-r--r--lcd4linux.conf.sample10
-rw-r--r--pixmap.c9
10 files changed, 91 insertions, 33 deletions
diff --git a/MatrixOrbital.c b/MatrixOrbital.c
index c188663..1e9a5dc 100644
--- a/MatrixOrbital.c
+++ b/MatrixOrbital.c
@@ -1,4 +1,4 @@
-/* $Id: MatrixOrbital.c,v 1.10 2000/03/23 07:24:48 reinelt Exp $
+/* $Id: MatrixOrbital.c,v 1.11 2000/03/25 05:50:43 reinelt Exp $
*
* driver for Matrix Orbital serial display modules
*
@@ -20,6 +20,11 @@
*
*
* $Log: MatrixOrbital.c,v $
+ * Revision 1.11 2000/03/25 05:50:43 reinelt
+ *
+ * memory leak in Raster_flush closed
+ * driver family logic changed
+ *
* Revision 1.10 2000/03/23 07:24:48 reinelt
*
* PPM driver up and running (but slow!)
@@ -519,5 +524,5 @@ DISPLAY MatrixOrbital[] = {
{ "LCD2021", 2, 20, XRES, YRES, BARS, MO_init, MO_clear, MO_put, MO_bar, MO_flush },
{ "LCD2041", 4, 20, XRES, YRES, BARS, MO_init, MO_clear, MO_put, MO_bar, MO_flush },
{ "LCD4021", 2, 40, XRES, YRES, BARS, MO_init, MO_clear, MO_put, MO_bar, MO_flush },
- { "" }
+ { NULL }
};
diff --git a/Raster.c b/Raster.c
index 34c4cd9..1159612 100644
--- a/Raster.c
+++ b/Raster.c
@@ -1,4 +1,4 @@
-/* $Id: Raster.c,v 1.2 2000/03/24 11:36:56 reinelt Exp $
+/* $Id: Raster.c,v 1.3 2000/03/25 05:50:43 reinelt Exp $
*
* driver for raster formats
*
@@ -20,6 +20,11 @@
*
*
* $Log: Raster.c,v $
+ * Revision 1.3 2000/03/25 05:50:43 reinelt
+ *
+ * memory leak in Raster_flush closed
+ * driver family logic changed
+ *
* Revision 1.2 2000/03/24 11:36:56 reinelt
*
* new syntax for raster configuration
@@ -65,14 +70,16 @@ static int background=0;
int Raster_flush (void)
{
int xsize, ysize, row, col;
- unsigned char *buffer;
unsigned char R[3], G[3], B[3];
+ static unsigned char *buffer=NULL;
xsize=2*border+(Display.cols-1)*cgap+Display.cols*Display.xres*(pixel+pgap);
ysize=2*border+(Display.rows-1)*rgap+Display.rows*Display.yres*(pixel+pgap);
- if ((buffer=malloc(xsize*ysize*sizeof(*buffer)))==NULL)
- return -1;
+ if (buffer==NULL) {
+ if ((buffer=malloc(xsize*ysize*sizeof(*buffer)))==NULL)
+ return -1;
+ }
memset (buffer, 0, xsize*ysize*sizeof(*buffer));
@@ -107,7 +114,6 @@ int Raster_flush (void)
printf("%c%c%c", R[i], G[i], B[i]);
}
}
-
return 0;
}
@@ -179,5 +185,5 @@ int Raster_bar (int type, int row, int col, int max, int len1, int len2)
DISPLAY Raster[] = {
{ "PPM", 0, 0, 0, 0, BARS, Raster_init, Raster_clear, Raster_put, Raster_bar, Raster_flush },
- { "" }
+ { NULL }
};
diff --git a/Skeleton.c b/Skeleton.c
index 566ce42..8dcd8b1 100644
--- a/Skeleton.c
+++ b/Skeleton.c
@@ -1,4 +1,4 @@
-/* $Id: Skeleton.c,v 1.2 2000/03/22 07:33:50 reinelt Exp $
+/* $Id: Skeleton.c,v 1.3 2000/03/25 05:50:43 reinelt Exp $
*
* skeleton driver for new display modules
*
@@ -20,6 +20,11 @@
*
*
* $Log: Skeleton.c,v $
+ * Revision 1.3 2000/03/25 05:50:43 reinelt
+ *
+ * memory leak in Raster_flush closed
+ * driver family logic changed
+ *
* Revision 1.2 2000/03/22 07:33:50 reinelt
*
* FAQ added
@@ -82,5 +87,5 @@ int Skel_flush (void)
DISPLAY Skeleton[] = {
{ "Skeleton", 4, 20, 5, 8, BAR_L | BAR_R, Skel_init, Skel_clear, Skel_put, Skel_bar, Skel_flush },
- { "" }
+ { NULL }
};
diff --git a/XWindow.c b/XWindow.c
index d3bbc22..0072a94 100644
--- a/XWindow.c
+++ b/XWindow.c
@@ -1,4 +1,4 @@
-/* $Id: XWindow.c,v 1.3 2000/03/24 11:36:56 reinelt Exp $
+/* $Id: XWindow.c,v 1.4 2000/03/25 05:50:43 reinelt Exp $
*
* driver for X11
*
@@ -20,6 +20,11 @@
*
*
* $Log: XWindow.c,v $
+ * Revision 1.4 2000/03/25 05:50:43 reinelt
+ *
+ * memory leak in Raster_flush closed
+ * driver family logic changed
+ *
* Revision 1.3 2000/03/24 11:36:56 reinelt
*
* new syntax for raster configuration
@@ -186,5 +191,5 @@ int X_bar (int type, int row, int col, int max, int len1, int len2)
DISPLAY XWindow[] = {
{ "X11", 0, 0, 0, 0, BARS, X_init, X_clear, X_put, X_bar, X_flush },
- { "" }
+ { NULL }
};
diff --git a/display.c b/display.c
index ec9a801..c4f545b 100644
--- a/display.c
+++ b/display.c
@@ -1,4 +1,4 @@
-/* $Id: display.c,v 1.10 2000/03/23 07:24:48 reinelt Exp $
+/* $Id: display.c,v 1.11 2000/03/25 05:50:43 reinelt Exp $
*
* framework for device drivers
*
@@ -20,6 +20,11 @@
*
*
* $Log: display.c,v $
+ * Revision 1.11 2000/03/25 05:50:43 reinelt
+ *
+ * memory leak in Raster_flush closed
+ * driver family logic changed
+ *
* Revision 1.10 2000/03/23 07:24:48 reinelt
*
* PPM driver up and running (but slow!)
@@ -108,7 +113,7 @@ FAMILY Driver[] = {
{ "Matrix Orbital", MatrixOrbital },
{ "Raster", Raster },
{ "X Window System", XWindow },
- { "" }
+ { NULL }
};
@@ -120,9 +125,9 @@ int lcd_list (void)
printf ("available display drivers:");
- for (i=0; Driver[i].name[0]; i++) {
+ for (i=0; Driver[i].name; i++) {
printf ("\n %-16s:", Driver[i].name);
- for (j=0; Driver[i].Display[j].name[0]; j++) {
+ for (j=0; Driver[i].Display[j].name; j++) {
printf (" %s", Driver[i].Display[j].name);
}
}
@@ -133,8 +138,8 @@ int lcd_list (void)
int lcd_init (char *display)
{
int i, j;
- for (i=0; Driver[i].name[0]; i++) {
- for (j=0; Driver[i].Display[j].name[0]; j++) {
+ for (i=0; Driver[i].name; i++) {
+ for (j=0; Driver[i].Display[j].name; j++) {
if (strcmp (Driver[i].Display[j].name, display)==0) {
Display=&Driver[i].Display[j];
return Display->init(Display);
diff --git a/display.h b/display.h
index 208ba83..f519467 100644
--- a/display.h
+++ b/display.h
@@ -1,4 +1,4 @@
-/* $Id: display.h,v 1.8 2000/03/22 15:36:21 reinelt Exp $
+/* $Id: display.h,v 1.9 2000/03/25 05:50:43 reinelt Exp $
*
* framework for device drivers
*
@@ -20,6 +20,11 @@
*
*
* $Log: display.h,v $
+ * Revision 1.9 2000/03/25 05:50:43 reinelt
+ *
+ * memory leak in Raster_flush closed
+ * driver family logic changed
+ *
* Revision 1.8 2000/03/22 15:36:21 reinelt
*
* added '-l' switch (list drivers)
@@ -69,7 +74,7 @@
#define BAR_HV (BAR_H | BAR_V)
typedef struct DISPLAY {
- char name[16];
+ char *name;
int rows;
int cols;
int xres;
@@ -83,7 +88,7 @@ typedef struct DISPLAY {
} DISPLAY;
typedef struct {
- char name[16];
+ char *name;
DISPLAY *Display;
} FAMILY;
diff --git a/fontmap.c b/fontmap.c
index 3dc81e5..dc3746d 100644
--- a/fontmap.c
+++ b/fontmap.c
@@ -1,4 +1,4 @@
-/* $Id: fontmap.c,v 1.2 2000/03/24 11:36:56 reinelt Exp $
+/* $Id: fontmap.c,v 1.3 2000/03/25 05:50:43 reinelt Exp $
*
* 5x8 font
*
@@ -20,6 +20,11 @@
*
*
* $Log: fontmap.c,v $
+ * Revision 1.3 2000/03/25 05:50:43 reinelt
+ *
+ * memory leak in Raster_flush closed
+ * driver family logic changed
+ *
* Revision 1.2 2000/03/24 11:36:56 reinelt
*
* new syntax for raster configuration
@@ -840,4 +845,12 @@ unsigned char Fontmap[256][8]={
b___O__,
b______,
b______ },
+ [0xb0] { b__OOO_,
+ b__O_O_,
+ b__OOO_,
+ b______,
+ b______,
+ b______,
+ b______,
+ b______ },
};
diff --git a/lcd4linux.c b/lcd4linux.c
index c471843..0d48d36 100644
--- a/lcd4linux.c
+++ b/lcd4linux.c
@@ -1,4 +1,4 @@
-/* $Id: lcd4linux.c,v 1.11 2000/03/24 11:36:56 reinelt Exp $
+/* $Id: lcd4linux.c,v 1.12 2000/03/25 05:50:43 reinelt Exp $
*
* LCD4Linux
*
@@ -20,6 +20,11 @@
*
*
* $Log: lcd4linux.c,v $
+ * Revision 1.12 2000/03/25 05:50:43 reinelt
+ *
+ * memory leak in Raster_flush closed
+ * driver family logic changed
+ *
* Revision 1.11 2000/03/24 11:36:56 reinelt
*
* new syntax for raster configuration
@@ -144,14 +149,18 @@ void main (int argc, char *argv[])
process_init();
+ // FIXME: just debugging
+ lcd_clear();
+ lcd_put (1, 1, "so what!");
+ lcd_bar (BAR_R|BAR_H2, 2,1,50,19,46);
+ lcd_flush();
+ exit (0);
+
lcd_clear();
lcd_put (1, 1, "* LCD4Linux V" VERSION " *");
lcd_put (2, 1, " (c) 2000 M.Reinelt");
lcd_flush();
- // FIXME: just debugging
- exit (0);
-
sleep (3);
lcd_clear();
diff --git a/lcd4linux.conf.sample b/lcd4linux.conf.sample
index 3a2be42..9be532f 100644
--- a/lcd4linux.conf.sample
+++ b/lcd4linux.conf.sample
@@ -5,11 +5,11 @@
#Display X11
DISPLAY PPM
-size 20x4
+size 10x2
font 5x8
-pixel 5+1
-gap 5x5
-border 20
+pixel 3+1
+gap 4x4
+border 5
foreground 102000
halfground 70c000
background 80d000
@@ -17,7 +17,7 @@ background 80d000
#Row1 "*** %o %v ***"
#Row2 "%p CPU %r MB RAM"
-#Row3 "Busy %cu%% $r10cs+cb"
+#Row3 "Busy %cb%% $r10cs+cb"
#Row4 "Load %l1%L$r10l1"
Row1 "Load %l1%L$r10cs+cb"
diff --git a/pixmap.c b/pixmap.c
index 24a65be..3f20c9e 100644
--- a/pixmap.c
+++ b/pixmap.c
@@ -1,4 +1,4 @@
-/* $Id: pixmap.c,v 1.3 2000/03/24 11:36:56 reinelt Exp $
+/* $Id: pixmap.c,v 1.4 2000/03/25 05:50:43 reinelt Exp $
*
* generic pixmap driver
*
@@ -20,6 +20,11 @@
*
*
* $Log: pixmap.c,v $
+ * Revision 1.4 2000/03/25 05:50:43 reinelt
+ *
+ * memory leak in Raster_flush closed
+ * driver family logic changed
+ *
* Revision 1.3 2000/03/24 11:36:56 reinelt
*
* new syntax for raster configuration
@@ -107,7 +112,7 @@ int pix_put (int row, int col, char *text)
col*=XRES;
while (*text && col<COLS) {
- c=*text;
+ c=*(unsigned char*)text;
for (y=0; y<YRES; y++) {
mask=1<<XRES;
for (x=0; x<XRES; x++) {