From 74b5571e8bffce769e6fb5a1b7ec71885ce6c326 Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Tue, 19 Jul 2016 17:06:22 -0700 Subject: [PATCH] Remove baseband::start()/stop() and related message. --- firmware/application/ais_app.cpp | 7 ------- firmware/application/baseband_api.cpp | 12 ------------ firmware/application/baseband_api.hpp | 3 --- firmware/application/capture_app.cpp | 7 ------- firmware/application/ert_app.cpp | 7 ------- firmware/application/receiver_model.cpp | 5 ----- firmware/application/tpms_app.cpp | 7 ------- firmware/common/message.hpp | 13 ------------- 8 files changed, 61 deletions(-) diff --git a/firmware/application/ais_app.cpp b/firmware/application/ais_app.cpp index 39cc0e14..543e5553 100644 --- a/firmware/application/ais_app.cpp +++ b/firmware/application/ais_app.cpp @@ -308,12 +308,6 @@ AISAppView::AISAppView(NavigationView&) { 1, }); - baseband::start({ - .mode = 3, - .sampling_rate = sampling_rate, - .decimation_factor = 1, - }); - options_channel.on_change = [this](size_t, OptionsField::value_t v) { this->on_frequency_changed(v); }; @@ -333,7 +327,6 @@ AISAppView::AISAppView(NavigationView&) { } AISAppView::~AISAppView() { - baseband::stop(); radio::disable(); baseband::shutdown(); diff --git a/firmware/application/baseband_api.cpp b/firmware/application/baseband_api.cpp index a28be777..35738010 100644 --- a/firmware/application/baseband_api.cpp +++ b/firmware/application/baseband_api.cpp @@ -78,18 +78,6 @@ void WFMConfig::apply() const { audio::set_rate(audio::Rate::Hz_48000); } -void start(BasebandConfiguration configuration) { - BasebandConfigurationMessage message { configuration }; - send_message(&message); -} - -void stop() { - BasebandConfigurationMessage message { - .configuration = { }, - }; - send_message(&message); -} - static bool baseband_image_running = false; void run_image(const portapack::spi_flash::image_tag_t image_tag) { diff --git a/firmware/application/baseband_api.hpp b/firmware/application/baseband_api.hpp index c12b08fd..10f57a86 100644 --- a/firmware/application/baseband_api.hpp +++ b/firmware/application/baseband_api.hpp @@ -52,9 +52,6 @@ struct WFMConfig { void apply() const; }; -void start(BasebandConfiguration configuration); -void stop(); - void run_image(const portapack::spi_flash::image_tag_t image_tag); void shutdown(); diff --git a/firmware/application/capture_app.cpp b/firmware/application/capture_app.cpp index 1ccc9aa9..87d40114 100644 --- a/firmware/application/capture_app.cpp +++ b/firmware/application/capture_app.cpp @@ -77,12 +77,6 @@ CaptureAppView::CaptureAppView(NavigationView& nav) { 1, }); - baseband::start({ - .mode = toUType(ReceiverModel::Mode::Capture), - .sampling_rate = sampling_rate, - .decimation_factor = 1, - }); - record_view.set_sampling_rate(sampling_rate / 8); record_view.on_error = [&nav](std::string message) { nav.display_modal("Error", message); @@ -90,7 +84,6 @@ CaptureAppView::CaptureAppView(NavigationView& nav) { } CaptureAppView::~CaptureAppView() { - baseband::stop(); radio::disable(); baseband::shutdown(); diff --git a/firmware/application/ert_app.cpp b/firmware/application/ert_app.cpp index 711f1284..269b1096 100644 --- a/firmware/application/ert_app.cpp +++ b/firmware/application/ert_app.cpp @@ -136,12 +136,6 @@ ERTAppView::ERTAppView(NavigationView&) { 1, }); - baseband::start({ - .mode = 6, - .sampling_rate = sampling_rate, - .decimation_factor = 1, - }); - logger = std::make_unique(); if( logger ) { logger->append("ert.txt"); @@ -149,7 +143,6 @@ ERTAppView::ERTAppView(NavigationView&) { } ERTAppView::~ERTAppView() { - baseband::stop(); radio::disable(); baseband::shutdown(); diff --git a/firmware/application/receiver_model.cpp b/firmware/application/receiver_model.cpp index cf8607b8..bd5def05 100644 --- a/firmware/application/receiver_model.cpp +++ b/firmware/application/receiver_model.cpp @@ -154,7 +154,6 @@ void ReceiverModel::enable() { void ReceiverModel::disable() { enabled_ = false; update_antenna_bias(); - baseband::stop(); // TODO: Responsibility for enabling/disabling the radio is muddy. // Some happens in ReceiverModel, some inside radio namespace. @@ -225,13 +224,9 @@ void ReceiverModel::update_baseband_configuration() { // protocols that need quick RX/TX turn-around. // Disabling baseband while changing sampling rates seems like a good idea... - baseband::stop(); - radio::set_baseband_rate(sampling_rate() * baseband_oversampling()); update_tuning_frequency(); radio::set_baseband_decimation_by(baseband_oversampling()); - - baseband::start(baseband_configuration); } void ReceiverModel::update_headphone_volume() { diff --git a/firmware/application/tpms_app.cpp b/firmware/application/tpms_app.cpp index a56c97e8..0c96971c 100644 --- a/firmware/application/tpms_app.cpp +++ b/firmware/application/tpms_app.cpp @@ -187,12 +187,6 @@ TPMSAppView::TPMSAppView(NavigationView&) { 1, }); - baseband::start({ - .mode = 5, - .sampling_rate = sampling_rate, - .decimation_factor = 1, - }); - options_band.on_change = [this](size_t, OptionsField::value_t v) { this->on_band_changed(v); }; @@ -205,7 +199,6 @@ TPMSAppView::TPMSAppView(NavigationView&) { } TPMSAppView::~TPMSAppView() { - baseband::stop(); radio::disable(); baseband::shutdown(); diff --git a/firmware/common/message.hpp b/firmware/common/message.hpp index 725c328b..1e560ba4 100644 --- a/firmware/common/message.hpp +++ b/firmware/common/message.hpp @@ -51,7 +51,6 @@ public: ChannelStatistics = 2, DisplayFrameSync = 3, AudioStatistics = 4, - BasebandConfiguration = 5, TPMSPacket = 6, Shutdown = 8, AISPacket = 7, @@ -213,18 +212,6 @@ struct BasebandConfiguration { } }; -class BasebandConfigurationMessage : public Message { -public: - constexpr BasebandConfigurationMessage( - const BasebandConfiguration& configuration - ) : Message { ID::BasebandConfiguration }, - configuration { configuration } - { - } - - BasebandConfiguration configuration; -}; - class SpectrumStreamingConfigMessage : public Message { public: enum class Mode : uint32_t {