C-Netz: Fixed multi-transceiver mode and show channel in various logs

This commit is contained in:
Andreas Eversberg
2016-07-31 15:09:46 +02:00
parent eb8a22e2c2
commit f729b32745
6 changed files with 91 additions and 74 deletions

View File

@@ -17,6 +17,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#define CHAN cnetz->sender.kanal
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
@@ -638,7 +640,7 @@ again:
if (cnetz->sched_switch_mode && cnetz->sched_r_m == 0) {
if (--cnetz->sched_switch_mode == 0) {
/* OgK / SpK(K) / SpK(V) */
PDEBUG(DDSP, DEBUG_INFO, "Switching channel (mode)\n");
PDEBUG_CHAN(DDSP, DEBUG_INFO, "Switching channel (mode)\n");
cnetz_set_dsp_mode(cnetz, cnetz->sched_dsp_mode);
}
}
@@ -829,13 +831,13 @@ void unshrink_speech(cnetz_t *cnetz, int16_t *speech_buffer, int count)
void cnetz_set_dsp_mode(cnetz_t *cnetz, enum dsp_mode mode)
{
PDEBUG(DDSP, DEBUG_DEBUG, "DSP mode %d -> %d\n", cnetz->dsp_mode, mode);
PDEBUG_CHAN(DDSP, DEBUG_DEBUG, "DSP mode %d -> %d\n", cnetz->dsp_mode, mode);
cnetz->dsp_mode = mode;
}
void cnetz_set_sched_dsp_mode(cnetz_t *cnetz, enum dsp_mode mode, int frames_ahead)
{
PDEBUG(DDSP, DEBUG_DEBUG, "Schedule DSP mode %d -> %d in %d frames\n", cnetz->dsp_mode, mode, frames_ahead);
PDEBUG_CHAN(DDSP, DEBUG_DEBUG, " Schedule DSP mode %d -> %d in %d frames\n", cnetz->dsp_mode, mode, frames_ahead);
cnetz->sched_dsp_mode = mode;
cnetz->sched_switch_mode = frames_ahead;
}