- 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
This commit is contained in:
Diane Bruce 2006-01-15 23:32:39 +00:00
parent c3ab5968fa
commit 491cb12eec
3 changed files with 11 additions and 13 deletions

6
configure vendored
View File

@ -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"

View File

@ -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")

View File

@ -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 <sys/io.h>
#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;