Mute audio in FSK mode.

Addresses #17.
This commit is contained in:
Jared Boone 2015-07-17 10:05:54 -07:00
parent 565ea41e92
commit 43d13ab47c

View File

@ -409,6 +409,14 @@ protected:
for(size_t i=0; i<audio_buffer.count; i++) { for(size_t i=0; i<audio_buffer.count; i++) {
audio_buffer.p[i].left = audio_buffer.p[i].right = audio.p[i]; audio_buffer.p[i].left = audio_buffer.p[i].right = audio.p[i];
} }
i2s::i2s0::tx_unmute();
}
void mute_audio() {
// TODO: Feed audio stats? What if baseband never produces audio?
// TODO: How should audio stats behave if I *sometimes* mute audio?
i2s::i2s0::tx_mute();
} }
}; };
@ -632,6 +640,8 @@ public:
auto demodulated = demod.execute(channel, work_demod_buffer); auto demodulated = demod.execute(channel, work_demod_buffer);
mute_audio();
for(size_t i=0; i<demodulated.count; i++) { for(size_t i=0; i<demodulated.count; i++) {
clock_recovery.execute(demodulated.p[i], symbol_handler_fn); clock_recovery.execute(demodulated.p[i], symbol_handler_fn);
} }
@ -764,7 +774,6 @@ static void init() {
i2s::i2s0::tx_start(); i2s::i2s0::tx_start();
i2s::i2s0::rx_start(); i2s::i2s0::rx_start();
i2s::i2s0::tx_unmute();
LPC_CREG->DMAMUX = portapack::gpdma_mux; LPC_CREG->DMAMUX = portapack::gpdma_mux;
gpdma::controller.enable(); gpdma::controller.enable();