summaryrefslogtreecommitdiff
path: root/ztcfg.c
diff options
context:
space:
mode:
authorjim <jim@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2004-12-22 04:44:26 +0000
committerjim <jim@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2004-12-22 04:44:26 +0000
commit5ccad649b6fbb917cecf9530ba64814459dfe565 (patch)
treed4290c0877018d339fda18f5323952c88239b157 /ztcfg.c
parent35c0c5037ea5cb43b560d93137e4fef09fd1f3da (diff)
Changed out VHDL code so that interrupt handling would be much more efficient
and fully handle all functions git-svn-id: http://svn.digium.com/svn/zaptel/trunk@513 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'ztcfg.c')
-rwxr-xr-xztcfg.c32
1 files changed, 20 insertions, 12 deletions
diff --git a/ztcfg.c b/ztcfg.c
index f780a4a..52a09a1 100755
--- a/ztcfg.c
+++ b/ztcfg.c
@@ -806,7 +806,7 @@ int cor_thresh(char *keyword, char *args)
if (res != 1) {
error("Invalid value '%s', should be a number > 0.\n", realargs[0]);
}
- corthresh = x;
+ corthresh = x + 1;
return 0;
}
@@ -881,11 +881,13 @@ static int rad_chanconfig(char *keyword, char *args)
return -1;
for (x=1;x<ZT_MAX_CHANNELS;x++) {
if (chans[x]) {
-
p.radpar = ZT_RADPAR_NUMTONES;
if (ind_ioctl(x,fd,ZT_RADIO_GETPARAM,&p) == -1)
error("Cannot get number of tones chanel %d\n",x);
n = p.data;
+ p.radpar = ZT_RADPAR_INITTONE;
+ if (ind_ioctl(x,fd,ZT_RADIO_SETPARAM,&p) == -1)
+ error("Cannot init tones chanel %d\n",x);
if (!rxtones[0]) for(i = 1; i <= n; i++)
{
if (rxtones[i])
@@ -912,12 +914,15 @@ static int rad_chanconfig(char *keyword, char *args)
if (ind_ioctl(x,fd,ZT_RADIO_SETPARAM,&p) == -1)
error("Cannot set txtone on channel %d\n",x);
}
- } else { /* if we have DCS receive */
- p.radpar = ZT_RADPAR_RXTONE;
- p.index = 0;
- p.data = rxtones[0];
- if (ind_ioctl(x,fd,ZT_RADIO_SETPARAM,&p) == -1)
- error("Cannot set DCS rxtone on channel %d\n",x);
+ } else { /* if we may have DCS receive */
+ if (rxtones[0])
+ {
+ p.radpar = ZT_RADPAR_RXTONE;
+ p.index = 0;
+ p.data = rxtones[0];
+ if (ind_ioctl(x,fd,ZT_RADIO_SETPARAM,&p) == -1)
+ error("Cannot set DCS rxtone on channel %d\n",x);
+ }
}
if (txtones[0])
{
@@ -955,10 +960,13 @@ static int rad_chanconfig(char *keyword, char *args)
if (ind_ioctl(x,fd,ZT_RADIO_SETPARAM,&p) == -1)
error("Cannot set exttone on channel %d\n",x);
}
- p.radpar = ZT_RADPAR_CORTHRESH;
- p.data = corthresh;
- if (ind_ioctl(x,fd,ZT_RADIO_SETPARAM,&p) == -1)
- error("Cannot set corthresh on channel %d\n",x);
+ if (corthresh)
+ {
+ p.radpar = ZT_RADPAR_CORTHRESH;
+ p.data = corthresh - 1;
+ if (ind_ioctl(x,fd,ZT_RADIO_SETPARAM,&p) == -1)
+ error("Cannot set corthresh on channel %d\n",x);
+ }
}
}
clear_fields();