1diff -u -r cwdaemon-0.5/cwdaemon.c cwdaemon-0.5-mod/cwdaemon.c 2--- cwdaemon-0.5/cwdaemon.c 2003-05-19 10:58:40.000000000 -0600 3+++ cwdaemon-0.5-mod/cwdaemon.c 2003-07-19 16:02:10.000000000 -0600 4@@ -54,6 +54,8 @@ 5 unsigned int ptt_delay = 0; /* default = off*/ 6 int ptt_timer_running = 0; 7 8+int keyer_data; /* status of the automatic keyer */ 9+ 10 struct timeval now,end,left; 11 12 #define MAXMORSE 4000 13@@ -125,6 +127,7 @@ 14 init : ttys_init, 15 free : ttys_free, 16 reset : ttys_reset, 17+ status : ttys_status, 18 cw_on : ttys_cw_on, 19 cw_off : ttys_cw_off, 20 ptt_on : ttys_ptt_on, 21@@ -138,6 +141,7 @@ 22 init : lp_init, 23 free : lp_free, 24 reset : lp_reset, 25+ status : lp_status, 26 cw_on : lp_cw_on, 27 cw_off : lp_cw_off, 28 ptt_on : lp_ptt_on, 29@@ -900,6 +904,27 @@ 30 while (1) 31 { 32 udelay (1000); /*prevent 100% CPU */ 33+ 34+ keyer_data = cwdev->status(cwdev); 35+ if (keyer_data == 13) /* dash */ 36+ { 37+ debug("dash"); 38+ playbeep(dash); 39+ udelay (eldelay / morse_speed); /* delay after the element */ 40+ continue; /* don't let cwdaemon do anything else if the key is still in use */ 41+ } 42+ else 43+ { 44+ if (keyer_data == 12) /* dot */ 45+ { 46+ debug("dot"); 47+ playbeep(dot); 48+ udelay (eldelay / morse_speed); /* delay after the element */ 49+ continue; /* don't let cwdaemon do anything else if the key is still in use */ 50+ } 51+ } 52+ 53+ 54 if (recv_code ()) 55 playmorsestring (morsetext); 56 /* check for ptt off timer */ 57diff -u -r cwdaemon-0.5/cwdaemon.h cwdaemon-0.5-mod/cwdaemon.h 58--- cwdaemon-0.5/cwdaemon.h 2003-05-05 14:09:41.000000000 -0600 59+++ cwdaemon-0.5-mod/cwdaemon.h 2003-07-19 16:08:33.000000000 -0600 60@@ -90,6 +90,7 @@ 61 int (*init)(struct cwdev_s *); 62 int (*free)(struct cwdev_s *); 63 int (*reset)(struct cwdev_s *); 64+ int (*status)(struct cwdev_s *); 65 int (*cw_on)(struct cwdev_s *); 66 int (*cw_off)(struct cwdev_s *); 67 int (*ptt_on)(struct cwdev_s *); 68@@ -108,6 +109,7 @@ 69 int lp_init(cwdevice *dev); 70 int lp_free(cwdevice *dev); 71 int lp_reset(cwdevice *dev); 72+int lp_status(cwdevice *dev); 73 int lp_cw_on(cwdevice *dev); 74 int lp_cw_off(cwdevice *dev); 75 int lp_ptt_on(cwdevice *dev); 76@@ -120,6 +122,7 @@ 77 int ttys_init(cwdevice *dev); 78 int ttys_free(cwdevice *dev); 79 int ttys_reset(cwdevice *dev); 80+int ttys_status(cwdevice *dev); 81 int ttys_cw_on(cwdevice *dev); 82 int ttys_cw_off(cwdevice *dev); 83 int ttys_ptt_on(cwdevice *dev); 84diff -u -r cwdaemon-0.5/lp.c cwdaemon-0.5-mod/lp.c 85--- cwdaemon-0.5/lp.c 2003-05-05 14:09:41.000000000 -0600 86+++ cwdaemon-0.5-mod/lp.c 2003-07-19 16:11:31.000000000 -0600 87@@ -3,6 +3,29 @@ 88 89 /* LP functions */ 90 91+int lp_status(cwdevice *dev) 92+{ 93+ int port_data; 94+ 95+ if (ioperm (dev->base+1, 3, 1) == -1) 96+ { 97+ errmsg ("Open lp port 0x%x, %d", dev->base, dev->base); 98+ exit (1); 99+ } 100+ 101+ 102+ port_data = inb(dev->base+1); 103+ if ((port_data & 0x10) != 0x10) /* Check for pin 13 */ 104+ return 13; /* dash */ 105+ else 106+ { 107+ if ((port_data & 0x20) != 0x20) /* Check for pin 12 */ 108+ return 12; /* dot */ 109+ else 110+ return 0; /* nothing */ 111+ } 112+} 113+ 114 int lp_init(cwdevice *dev) 115 { 116 if (ioperm (dev->base+2, 1, 1) == -1) 117diff -u -r cwdaemon-0.5/ttys.c cwdaemon-0.5-mod/ttys.c 118--- cwdaemon-0.5/ttys.c 2003-05-17 04:24:01.000000000 -0600 119+++ cwdaemon-0.5-mod/ttys.c 2003-07-19 16:05:52.000000000 -0600 120@@ -21,6 +21,12 @@ 121 122 /* ttyS functions */ 123 124+int ttys_status(cwdevice *dev) 125+{ 126+ /* Dummy function */ 127+ return 0; 128+} 129+ 130 int ttys_init(cwdevice *dev) 131 { 132 if (ioperm (dev->base, 8, 1) == -1) 133 134