diff --git a/firmware/application/receiver_model.cpp b/firmware/application/receiver_model.cpp index 52ba61d55..0162632de 100644 --- a/firmware/application/receiver_model.cpp +++ b/firmware/application/receiver_model.cpp @@ -122,13 +122,16 @@ void ReceiverModel::enable() { update_headphone_volume(); } -void ReceiverModel::disable() { - /* TODO: This is a dumb hack to stop baseband from working so hard. */ - BasebandConfigurationMessage message { - .configuration = { }, - }; - shared_memory.baseband_queue.push(message); +void ReceiverModel::baseband_disable() { + shared_memory.baseband_queue.push_and_wait( + BasebandConfigurationMessage { + .configuration = { }, + } + ); +} +void ReceiverModel::disable() { + baseband_disable(); radio::disable(); } @@ -172,9 +175,7 @@ void ReceiverModel::update_baseband_configuration() { // protocols that need quick RX/TX turn-around. // Disabling baseband while changing sampling rates seems like a good idea... - shared_memory.baseband_queue.push_and_wait(BasebandConfigurationMessage { - .configuration = { }, - }); + baseband_disable(); clock_manager.set_sampling_frequency(sampling_rate() * baseband_oversampling()); update_tuning_frequency(); diff --git a/firmware/application/receiver_model.hpp b/firmware/application/receiver_model.hpp index 818a21a60..aeeac7e41 100644 --- a/firmware/application/receiver_model.hpp +++ b/firmware/application/receiver_model.hpp @@ -107,6 +107,8 @@ private: void update_vga(); void update_baseband_configuration(); void update_headphone_volume(); + + void baseband_disable(); }; #endif/*__RECEIVER_MODEL_H__*/