aboutsummaryrefslogtreecommitdiffstats
path: root/display.c
diff options
context:
space:
mode:
authorreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2000-08-09 09:50:29 +0000
committerreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2000-08-09 09:50:29 +0000
commit1645d61018c24013525f3953613aaea56714bab4 (patch)
treeddf01503c9b524efbe08b2887ab9b9f0bed1dc55 /display.c
parent7ff246c0458df37567dcefebfd9a720f9b98cdb7 (diff)
downloadlcd4linux-1645d61018c24013525f3953613aaea56714bab4.tar.gz
[lcd4linux @ 2000-08-09 09:50:29 by reinelt]
opened 0.98 development removed driver-specific signal-handlers added 'quit'-function to driver structure added global signal-handler git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@61 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
Diffstat (limited to 'display.c')
-rw-r--r--display.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/display.c b/display.c
index 1925d00..ca3bb0c 100644
--- a/display.c
+++ b/display.c
@@ -1,4 +1,4 @@
-/* $Id: display.c,v 1.18 2000/05/02 23:07:48 herp Exp $
+/* $Id: display.c,v 1.19 2000/08/09 09:50:29 reinelt Exp $
*
* framework for device drivers
*
@@ -20,6 +20,13 @@
*
*
* $Log: display.c,v $
+ * Revision 1.19 2000/08/09 09:50:29 reinelt
+ *
+ * opened 0.98 development
+ * removed driver-specific signal-handlers
+ * added 'quit'-function to driver structure
+ * added global signal-handler
+ *
* Revision 1.18 2000/05/02 23:07:48 herp
* Crystalfontz initial coding
*
@@ -123,6 +130,8 @@
* int lcd_flush (void)
* flushes the framebuffer to the display
*
+ * int lcd_quit (void)
+ * de-initializes the driver
*/
#include <stdlib.h>
@@ -181,6 +190,7 @@ int lcd_init (char *driver)
for (j=0; Driver[i].Model[j].name; j++) {
if (strcmp (Driver[i].Model[j].name, driver)==0) {
Lcd=&Driver[i].Model[j];
+ if (Lcd->init==NULL) return 0;
return Lcd->init(Lcd);
}
}
@@ -205,6 +215,7 @@ int lcd_query (int *rows, int *cols, int *xres, int *yres, int *bars)
int lcd_clear (void)
{
+ if (Lcd->clear==NULL) return 0;
return Lcd->clear();
}
@@ -212,6 +223,7 @@ int lcd_put (int row, int col, char *text)
{
if (row<1 || row>Lcd->rows) return -1;
if (col<1 || col>Lcd->cols) return -1;
+ if (Lcd->put==NULL) return 0;
return Lcd->put(row-1, col-1, text);
}
@@ -224,10 +236,18 @@ int lcd_bar (int type, int row, int col, int max, int len1, int len2)
len1=(double)max*log(len1+1)/log(max);
len2=(double)max*log(len2+1)/log(max);
}
+ if (Lcd->put==NULL) return 0;
return Lcd->bar (type & BAR_HV, row-1, col-1, max, len1, len2);
}
int lcd_flush (void)
{
+ if (Lcd->flush==NULL) return 0;
return Lcd->flush();
}
+
+int lcd_quit (void)
+{
+ if (Lcd->quit==NULL) return 0;
+ return Lcd->quit();
+}