TXINH config changes

This commit is contained in:
Alex Swedenburg 2015-11-17 09:27:31 -07:00
parent 1376c0c2fb
commit 64f9313f77
2 changed files with 56 additions and 0 deletions

10
audio.h
View File

@ -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. */

View File

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