Consolidate baseband disable code.

This commit is contained in:
Jared Boone 2016-01-10 11:10:13 -08:00
parent d9bfaaf805
commit 146caaab6f
2 changed files with 12 additions and 9 deletions

View File

@ -122,13 +122,16 @@ void ReceiverModel::enable() {
update_headphone_volume(); update_headphone_volume();
} }
void ReceiverModel::disable() { void ReceiverModel::baseband_disable() {
/* TODO: This is a dumb hack to stop baseband from working so hard. */ shared_memory.baseband_queue.push_and_wait(
BasebandConfigurationMessage message { BasebandConfigurationMessage {
.configuration = { }, .configuration = { },
}; }
shared_memory.baseband_queue.push(message); );
}
void ReceiverModel::disable() {
baseband_disable();
radio::disable(); radio::disable();
} }
@ -172,9 +175,7 @@ void ReceiverModel::update_baseband_configuration() {
// protocols that need quick RX/TX turn-around. // protocols that need quick RX/TX turn-around.
// Disabling baseband while changing sampling rates seems like a good idea... // Disabling baseband while changing sampling rates seems like a good idea...
shared_memory.baseband_queue.push_and_wait(BasebandConfigurationMessage { baseband_disable();
.configuration = { },
});
clock_manager.set_sampling_frequency(sampling_rate() * baseband_oversampling()); clock_manager.set_sampling_frequency(sampling_rate() * baseband_oversampling());
update_tuning_frequency(); update_tuning_frequency();

View File

@ -107,6 +107,8 @@ private:
void update_vga(); void update_vga();
void update_baseband_configuration(); void update_baseband_configuration();
void update_headphone_volume(); void update_headphone_volume();
void baseband_disable();
}; };
#endif/*__RECEIVER_MODEL_H__*/ #endif/*__RECEIVER_MODEL_H__*/