From 58deee6b03e396b6cba5e4e888940419c240866b Mon Sep 17 00:00:00 2001 From: reinelt <> Date: Wed, 9 Aug 2000 09:50:29 +0000 Subject: [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 --- HD44780.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'HD44780.c') diff --git a/HD44780.c b/HD44780.c index 3278ad2..a31db00 100644 --- a/HD44780.c +++ b/HD44780.c @@ -1,4 +1,4 @@ -/* $Id: HD44780.c,v 1.6 2000/07/31 10:43:44 reinelt Exp $ +/* $Id: HD44780.c,v 1.7 2000/08/09 09:50:29 reinelt Exp $ * * driver for display modules based on the HD44780 chip * @@ -20,6 +20,13 @@ * * * $Log: HD44780.c,v $ + * Revision 1.7 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.6 2000/07/31 10:43:44 reinelt * * some changes to support kernel-2.4 (different layout of various files in /proc) @@ -70,7 +77,6 @@ #include #include #include -#include #include #ifdef HAVE_SYS_IO_H #include @@ -340,8 +346,6 @@ int HD_clear (void) return 0; } -static void HD_quit (int signal); //forward declaration - int HD_init (LCD *Self) { int rows=-1, cols=-1; @@ -386,10 +390,6 @@ int HD_init (LCD *Self) HD_clear(); - signal(SIGINT, HD_quit); - signal(SIGQUIT, HD_quit); - signal(SIGTERM, HD_quit); - return 0; } @@ -518,17 +518,17 @@ int HD_flush (void) return 0; } -int lcd_hello (void); // prototype from lcd4linux.c - -static void HD_quit (int signal) +int HD_quit (void) { - debug ("got signal %d\n", signal); - HD_clear(); - lcd_hello(); - exit (0); + debug ("closing port 0x%x\n", Port); + if (ioperm(Port, 3, 0)!=0) { + fprintf (stderr, "HD44780: ioperm(0x%x) failed: %s\n", Port, strerror(errno)); + return -1; + } + return 0; } LCD HD44780[] = { - { "HD44780", 0, 0, XRES, YRES, BARS, HD_init, HD_clear, HD_put, HD_bar, HD_flush }, + { "HD44780", 0, 0, XRES, YRES, BARS, HD_init, HD_clear, HD_put, HD_bar, HD_flush, HD_quit }, { NULL } }; -- cgit v1.2.3