1.1 --- a/graphlcd-base/glcddrivers/port.c Mon Mar 30 18:40:54 2009 +0200
1.2 +++ b/graphlcd-base/glcddrivers/port.c Thu Apr 23 19:10:12 2009 +0200
1.3 @@ -16,19 +16,12 @@
1.4 #include <syslog.h>
1.5 #include <unistd.h>
1.6 #include <termios.h>
1.7 -#include <signal.h>
1.8 #include <sys/io.h>
1.9 #include <sys/ioctl.h>
1.10 #include <linux/ppdev.h>
1.11 #include <linux/parport.h>
1.12 -
1.13 -
1.14 -
1.15 #include "port.h"
1.16
1.17 -
1.18 -
1.19 -
1.20 namespace GLCD
1.21 {
1.22
1.23 @@ -286,34 +279,6 @@
1.24 {
1.25 }
1.26
1.27 -int cSerialPort::Open(const char * device, void (*FP)(int))
1.28 -{
1.29 - struct sigaction saio;
1.30 -
1.31 - if (FP == NULL) {
1.32 - return -1;
1.33 - }
1.34 -
1.35 - if (Open(device) == 0) {
1.36 - // install the signal handler before making the device asynchronous/
1.37 - saio.sa_handler = FP;
1.38 - sigemptyset (&saio.sa_mask);
1.39 - saio.sa_flags = 0;
1.40 - saio.sa_restorer = NULL;
1.41 - sigaction(SIGIO,&saio,NULL);
1.42 -
1.43 - // allow the process to receive SIGIO
1.44 - fcntl(fd, F_SETOWN, getpid());
1.45 - // Make the file descriptor asynchronous
1.46 - fcntl(fd, F_SETFL, FASYNC | O_NONBLOCK);
1.47 -
1.48 - return(0);
1.49 - }
1.50 - else {
1.51 - return -1;
1.52 - }
1.53 -}
1.54 -
1.55 int cSerialPort::Open(const char * device)
1.56 {
1.57 struct termios options;
1.58 @@ -352,17 +317,9 @@
1.59
1.60 int cSerialPort::Close()
1.61 {
1.62 - struct sigaction saio;
1.63 if (fd == -1)
1.64 return -1;
1.65 close(fd);
1.66 -
1.67 - saio.sa_handler = NULL;
1.68 - sigemptyset (&saio.sa_mask);
1.69 - saio.sa_flags = 0;
1.70 - saio.sa_restorer = NULL;
1.71 - sigaction(SIGIO,&saio,NULL);
1.72 -
1.73 return 0;
1.74 }
1.75
1.76 @@ -383,7 +340,6 @@
1.77 if (fd == -1)
1.78 return;
1.79 write(fd, data, length);
1.80 -// for (int x=0; x<length; x++) printf("0x%x ",data[x]);
1.81 }
1.82
1.83