From 5d9079f87f1d83452d452a6f198855ce03c6113e Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Thu, 27 Aug 2015 14:07:15 -0700 Subject: [PATCH] Stop streaming when changing baseband configuration. Without, the baseband would get confused. --- firmware/application/radio.cpp | 4 ++++ firmware/application/radio.hpp | 1 + firmware/application/receiver_model.cpp | 4 ++++ 3 files changed, 9 insertions(+) diff --git a/firmware/application/radio.cpp b/firmware/application/radio.cpp index bd0a8084..dcb6bfa7 100644 --- a/firmware/application/radio.cpp +++ b/firmware/application/radio.cpp @@ -161,6 +161,10 @@ void streaming_enable() { baseband_sgpio.streaming_enable(); } +void streaming_disable() { + baseband_sgpio.streaming_disable(); +} + void disable() { baseband_sgpio.streaming_disable(); baseband_codec.set_mode(max5864::Mode::Shutdown); diff --git a/firmware/application/radio.hpp b/firmware/application/radio.hpp index 280b96ab..442968aa 100644 --- a/firmware/application/radio.hpp +++ b/firmware/application/radio.hpp @@ -43,6 +43,7 @@ void set_baseband_filter_bandwidth(const uint32_t bandwidth_minimum); void set_baseband_decimation_by(const size_t n); void streaming_enable(); +void streaming_disable(); void disable(); extern rffc507x::RFFC507x first_if; diff --git a/firmware/application/receiver_model.cpp b/firmware/application/receiver_model.cpp index 009ae829..69ac44bf 100644 --- a/firmware/application/receiver_model.cpp +++ b/firmware/application/receiver_model.cpp @@ -171,6 +171,8 @@ void ReceiverModel::set_baseband_configuration(const BasebandConfiguration confi } void ReceiverModel::update_baseband_configuration() { + radio::streaming_disable(); + clock_manager.set_sampling_frequency(sampling_rate() * baseband_oversampling()); update_tuning_frequency(); radio::set_baseband_decimation_by(baseband_oversampling()); @@ -181,6 +183,8 @@ void ReceiverModel::update_baseband_configuration() { if( baseband_configuration.mode == 3 ) { update_fsk_configuration(); } + + radio::streaming_enable(); } void ReceiverModel::update_headphone_volume() {