mirror of https://github.com/wb2osz/direwolf.git
TXINH config changes
This commit is contained in:
parent
1376c0c2fb
commit
64f9313f77
10
audio.h
10
audio.h
|
@ -201,6 +201,16 @@ struct audio_s {
|
||||||
|
|
||||||
} octrl[NUM_OCTYPES];
|
} octrl[NUM_OCTYPES];
|
||||||
|
|
||||||
|
#define ICTYPE_TXINH 0
|
||||||
|
|
||||||
|
#define NUM_ICTYPES 1
|
||||||
|
|
||||||
|
struct {
|
||||||
|
int enable; /* should we bother checking this input? */
|
||||||
|
int gpio; /* GPIO number */
|
||||||
|
int invert; /* 1 = active low */
|
||||||
|
} ictrl[NUM_ICTYPES];
|
||||||
|
|
||||||
/* Transmit timing. */
|
/* Transmit timing. */
|
||||||
|
|
||||||
int dwait; /* First wait extra time for receiver squelch. */
|
int dwait; /* First wait extra time for receiver squelch. */
|
||||||
|
|
46
config.c
46
config.c
|
@ -1598,6 +1598,52 @@ void config_init (char *fname, struct audio_s *p_audio_config,
|
||||||
|
|
||||||
} /* end of PTT */
|
} /* end of PTT */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* INPUTS
|
||||||
|
*
|
||||||
|
* TXINH - TX holdoff input
|
||||||
|
*
|
||||||
|
* xxx GPIO [-]gpio-num (only type supported yet)
|
||||||
|
*/
|
||||||
|
|
||||||
|
else if (strcasecmp(t, "TXINH") == 0) {
|
||||||
|
int it;
|
||||||
|
char itname[8];
|
||||||
|
|
||||||
|
it = ICTYPE_TXINH;
|
||||||
|
strlcpy (itname, "TXINH", sizeof(itname));
|
||||||
|
|
||||||
|
t = split(NULL,0);
|
||||||
|
if (t == NULL) {
|
||||||
|
text_color_set(DW_COLOR_ERROR);
|
||||||
|
dw_printf ("Config file line %d: Missing input type name for %s command.\n", line, itname);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (strcasecmp(t, "GPIO") == 0) {
|
||||||
|
|
||||||
|
#if __WIN32__
|
||||||
|
text_color_set(DW_COLOR_ERROR);
|
||||||
|
dw_printf ("Config file line %d: %s with GPIO is only available on Linux.\n", line, itname);
|
||||||
|
#else
|
||||||
|
t = split(NULL,0);
|
||||||
|
if (t == NULL) {
|
||||||
|
text_color_set(DW_COLOR_ERROR);
|
||||||
|
dw_printf ("Config file line %d: Missing GPIO number for %s.\n", line, itname);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (*t == '-') {
|
||||||
|
p_audio_config->achan[channel].ictrl[it].gpio = atoi(t+1);
|
||||||
|
p_audio_config->achan[channel].ictrl[it].invert = 1;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
p_audio_config->achan[channel].ictrl[it].gpio = atoi(t);
|
||||||
|
p_audio_config->achan[channel].ictrl[it].invert = 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* DWAIT - Extra delay for receiver squelch.
|
* DWAIT - Extra delay for receiver squelch.
|
||||||
|
|
Loading…
Reference in New Issue