From 491cb12eec2e13833fb13b98523962a7951d9b4e Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Sun, 15 Jan 2006 23:32:39 +0000 Subject: [PATCH] - fixed ptt_unix.c to work with the non blocking ttyd0 for now (on freebsd) it was causing my grief with tx testing of OSS - fixed configure to fill in just start_oss.c for AUDIO git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@110 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- configure | 6 +++--- configure.ac | 4 +--- ptt_unix.c | 14 +++++++------- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/configure b/configure index e51b3ed3c..fca685a85 100755 --- a/configure +++ b/configure @@ -2,7 +2,7 @@ # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.53 for wsjt 0.9. # -# $Id: configure.ac 100 2006-01-14 15:47:35Z va3db $ +# $Id: configure.ac 102 2006-01-14 16:15:50Z va3db $ # # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 # Free Software Foundation, Inc. @@ -924,7 +924,7 @@ Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. -$Id: configure.ac 100 2006-01-14 15:47:35Z va3db $ +$Id: configure.ac 102 2006-01-14 16:15:50Z va3db $ _ACEOF exit 0 fi @@ -5742,7 +5742,7 @@ cat >>confdefs.h <<\_ACEOF #define USE_OSS 1 _ACEOF - AUDIO="jtaudio.c start_oss.c" + AUDIO="start_oss.c" CFLAGS="${CFLAGS} -DUSE_OSS" CPPFLAGS="${CPPFLAGS} -DUSE_OSS" diff --git a/configure.ac b/configure.ac index de42081b6..ef373ce45 100644 --- a/configure.ac +++ b/configure.ac @@ -239,15 +239,13 @@ if test "$alsa" = yes; then CPPFLAGS="${CPPFLAGS} -DUSE_ALSA" fi -dnl still not sure what OSS will require, but heres a first guess -db if test "$oss" = yes; then AC_DEFINE(USE_OSS, 1, [Define if you want OSS used.]) - AC_SUBST(AUDIO, "jtaudio.c start_oss.c") + AC_SUBST(AUDIO, "start_oss.c") CFLAGS="${CFLAGS} -DUSE_OSS" CPPFLAGS="${CPPFLAGS} -DUSE_OSS" fi -dnl XXX if test "$portaudio" = yes; then AC_DEFINE(USE_PORTAUDIO, 1, [Define if you want PORTAUDIO used.]) AC_SUBST(AUDIO, "a2d.f90 jtaudio.c start_portaudio.c") diff --git a/ptt_unix.c b/ptt_unix.c index 7a51e896b..98d6936ee 100644 --- a/ptt_unix.c +++ b/ptt_unix.c @@ -19,7 +19,7 @@ * for OSX. -db */ #if defined(BSD) -#define TTYNAME "/dev/ttyd%d" +#define TTYNAME "/dev/cuad%d" /* Use non blocking form */ #else #include #define TTYNAME "/dev/ttyS%d" @@ -28,7 +28,8 @@ /* Not quite right for size but '%d + 1' should be plenty enough -db */ #define TTYNAME_SIZE sizeof(TTYNAME)+1 -int ptt_(int *nport, int *ntx, int *iptt) +int +ptt_(int *nport, int *ntx, int *iptt) { static int nopen=0; int control = TIOCM_RTS | TIOCM_DTR; @@ -41,26 +42,25 @@ int ptt_(int *nport, int *ntx, int *iptt) } if(*ntx && (!nopen)) { - snprintf(s, TTYNAME_SIZE, TTYNAME, *nport); + snprintf(s, TTYNAME_SIZE, TTYNAME, (*nport) - 1); /* Comport 1 == dev 0 */ s[TTYNAME_SIZE] = '\0'; - //open the device + /* open the device */ if ((fd = open(s, O_RDWR | O_NDELAY)) < 0) { - fprintf(stderr, "device not found"); + fprintf(stderr, "Can't open %s.", s); return(1); } + nopen=1; return(0); } if(*ntx && nopen) { - // printf("Set DTR/RTS %d %d\n",TIOCMBIS,control); ioctl(fd, TIOCMBIS, &control); // Set DTR and RTS *iptt=1; } else { - // printf("Clear DTR/RTS %d %d\n",TIOCMBIC,control); ioctl(fd, TIOCMBIC, &control); close(fd); *iptt=0;