diff options
author | reinelt <> | 2000-08-09 09:50:29 +0000 |
---|---|---|
committer | reinelt <> | 2000-08-09 09:50:29 +0000 |
commit | 58deee6b03e396b6cba5e4e888940419c240866b (patch) | |
tree | ddf01503c9b524efbe08b2887ab9b9f0bed1dc55 /MatrixOrbital.c | |
parent | a7f2de2a1d1fb7b5c8b3ba277ea66f01e692dd18 (diff) | |
download | lcd4linux-58deee6b03e396b6cba5e4e888940419c240866b.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
Diffstat (limited to 'MatrixOrbital.c')
-rw-r--r-- | MatrixOrbital.c | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/MatrixOrbital.c b/MatrixOrbital.c index 5096ee0..a3e8077 100644 --- a/MatrixOrbital.c +++ b/MatrixOrbital.c @@ -1,4 +1,4 @@ -/* $Id: MatrixOrbital.c,v 1.17 2000/04/15 11:13:54 reinelt Exp $ +/* $Id: MatrixOrbital.c,v 1.18 2000/08/09 09:50:29 reinelt Exp $ * * driver for Matrix Orbital serial display modules * @@ -20,6 +20,13 @@ * * * $Log: MatrixOrbital.c,v $ + * Revision 1.18 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.17 2000/04/15 11:13:54 reinelt * * added '-d' (debugging) switch @@ -106,7 +113,6 @@ #include <string.h> #include <errno.h> #include <unistd.h> -#include <signal.h> #include <termios.h> #include <fcntl.h> @@ -386,8 +392,6 @@ int MO_clear (void) return 0; } -static void MO_quit (int signal); //forward declaration - int MO_init (LCD *Self) { char *port; @@ -442,10 +446,6 @@ int MO_init (LCD *Self) MO_write ("\376R", 2); // auto scroll off MO_write ("\376V", 2); // GPO off - signal(SIGINT, MO_quit); - signal(SIGQUIT, MO_quit); - signal(SIGTERM, MO_quit); - return 0; } @@ -567,23 +567,19 @@ int MO_flush (void) return 0; } -int lcd_hello (void); // prototype from lcd4linux.c - -static void MO_quit (int signal) +int MO_quit (void) { - debug ("got signal %d\n", signal); - MO_clear(); - lcd_hello(); + debug ("closing port %s\n", Port); close (Device); unlock_port(Port); - exit (0); + return (0); } LCD MatrixOrbital[] = { - { "LCD0821", 2, 8, XRES, YRES, BARS, MO_init, MO_clear, MO_put, MO_bar, MO_flush }, - { "LCD1621", 2, 16, XRES, YRES, BARS, MO_init, MO_clear, MO_put, MO_bar, MO_flush }, - { "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 }, + { "LCD0821", 2, 8, XRES, YRES, BARS, MO_init, MO_clear, MO_put, MO_bar, MO_flush, MO_quit }, + { "LCD1621", 2, 16, XRES, YRES, BARS, MO_init, MO_clear, MO_put, MO_bar, MO_flush, MO_quit }, + { "LCD2021", 2, 20, XRES, YRES, BARS, MO_init, MO_clear, MO_put, MO_bar, MO_flush, MO_quit }, + { "LCD2041", 4, 20, XRES, YRES, BARS, MO_init, MO_clear, MO_put, MO_bar, MO_flush, MO_quit }, + { "LCD4021", 2, 40, XRES, YRES, BARS, MO_init, MO_clear, MO_put, MO_bar, MO_flush, MO_quit }, { NULL } }; |