anetz/bnetz: Remove redundant code to enter idle state

This commit is contained in:
Andreas Eversberg 2016-03-05 08:02:13 +01:00
parent 01a29ccfaa
commit 9b8e359264
2 changed files with 8 additions and 9 deletions

View File

@ -131,6 +131,7 @@ int anetz_init(void)
}
static void anetz_timeout(struct timer *timer);
static void anetz_go_idle(anetz_t *anetz);
/* Create transceiver instance and link to a list. */
int anetz_create(const char *sounddev, int samplerate, int kanal, int loopback, double loss_volume)
@ -165,12 +166,11 @@ int anetz_create(const char *sounddev, int samplerate, int kanal, int loopback,
goto error;
}
/* go into idle state */
PDEBUG(DANETZ, DEBUG_INFO, "Entering IDLE state, sending 2280 Hz tone.\n");
anetz->state = ANETZ_FREI;
anetz->dsp_mode = DSP_MODE_TONE;
timer_init(&anetz->timer, anetz_timeout, anetz);
/* go into idle state */
anetz_go_idle(anetz);
return 0;
error:

View File

@ -239,6 +239,7 @@ int bnetz_init(void)
}
static void bnetz_timeout(struct timer *timer);
static void bnetz_go_idle(bnetz_t *bnetz);
/* Create transceiver instance and link to a list. */
int bnetz_create(const char *sounddev, int samplerate, int kanal, int gfs, int loopback, double loss_factor, const char *pilot)
@ -312,16 +313,14 @@ error_pilot:
goto error;
}
/* go into idle state */
PDEBUG(DBNETZ, DEBUG_INFO, "Entering IDLE state, sending 'Gruppenfreisignal' %d on channel %d.\n", gfs, kanal);
bnetz->state = BNETZ_FREI;
bnetz->dsp_mode = DSP_MODE_TELEGRAMM;
bnetz->gfs = gfs;
strncpy(bnetz->pilot_file, pilot_file, sizeof(bnetz->pilot_file) - 1);
strncpy(bnetz->pilot_on, pilot_on, sizeof(bnetz->pilot_on) - 1);
strncpy(bnetz->pilot_off, pilot_off, sizeof(bnetz->pilot_off) - 1);
timer_init(&bnetz->timer, bnetz_timeout, bnetz);
switch_channel_19(bnetz, 0);
/* go into idle state */
bnetz_go_idle(bnetz);
return 0;