diff options
author | reinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f> | 2000-08-09 09:50:29 +0000 |
---|---|---|
committer | reinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f> | 2000-08-09 09:50:29 +0000 |
commit | 1645d61018c24013525f3953613aaea56714bab4 (patch) | |
tree | ddf01503c9b524efbe08b2887ab9b9f0bed1dc55 /HD44780.c | |
parent | 7ff246c0458df37567dcefebfd9a720f9b98cdb7 (diff) | |
download | lcd4linux-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 '')
-rw-r--r-- | HD44780.c | 32 |
1 files changed, 16 insertions, 16 deletions
@@ -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 <string.h> #include <unistd.h> #include <time.h> -#include <signal.h> #include <errno.h> #ifdef HAVE_SYS_IO_H #include <sys/io.h> @@ -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 } }; |