From 4a57af64ce2a11d539b317637325ed78fdb75aa7 Mon Sep 17 00:00:00 2001 From: Brumi-2021 Date: Sat, 15 Jan 2022 23:09:42 +0100 Subject: [PATCH 1/4] =?UTF-8?q?=E2=80=9CAntenna=5FDC=5FBias=5Fmissing=5Fin?= =?UTF-8?q?=5FAIS=5Fand=5FRADIOSONDE=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- firmware/application/apps/ais_app.cpp | 14 ++++++++++---- firmware/application/apps/ui_sonde.cpp | 12 +++++++++--- hackrf | 2 +- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/firmware/application/apps/ais_app.cpp b/firmware/application/apps/ais_app.cpp index 7d42be86..a919ce11 100644 --- a/firmware/application/apps/ais_app.cpp +++ b/firmware/application/apps/ais_app.cpp @@ -307,8 +307,13 @@ AISAppView::AISAppView(NavigationView& nav) : nav_ { nav } { recent_entry_detail_view.hidden(true); target_frequency_ = initial_target_frequency; + + receiver_model.set_tuning_frequency(tuning_frequency()); + receiver_model.set_sampling_rate(sampling_rate); + receiver_model.set_baseband_bandwidth(baseband_bandwidth); + receiver_model.enable(); // Before using radio::enable(), but not updating Ant.DC-Bias. - radio::enable({ +/* radio::enable({ // this can be removed, previous version,no DC-bias control. tuning_frequency(), sampling_rate, baseband_bandwidth, @@ -316,8 +321,8 @@ AISAppView::AISAppView(NavigationView& nav) : nav_ { nav } { receiver_model.rf_amp(), static_cast(receiver_model.lna()), static_cast(receiver_model.vga()), - }); - + }); */ + options_channel.on_change = [this](size_t, OptionsField::value_t v) { this->on_frequency_changed(v); }; @@ -337,7 +342,8 @@ AISAppView::AISAppView(NavigationView& nav) : nav_ { nav } { } AISAppView::~AISAppView() { - radio::disable(); +/* radio::disable(); */ + receiver_model.disable(); // to switch off all, including DC bias. baseband::shutdown(); } diff --git a/firmware/application/apps/ui_sonde.cpp b/firmware/application/apps/ui_sonde.cpp index 12da24b2..f38fc3dd 100644 --- a/firmware/application/apps/ui_sonde.cpp +++ b/firmware/application/apps/ui_sonde.cpp @@ -100,7 +100,12 @@ SondeView::SondeView(NavigationView& nav) { use_crc = v; }; - radio::enable({ + receiver_model.set_tuning_frequency(tuning_frequency()); + receiver_model.set_sampling_rate(sampling_rate); + receiver_model.set_baseband_bandwidth(baseband_bandwidth); + receiver_model.enable(); // Before using radio::enable(), but not updating Ant.DC-Bias. + + /* radio::enable({ // this can be removed, previous version, no DC-bias ant. control. tuning_frequency(), sampling_rate, baseband_bandwidth, @@ -108,7 +113,7 @@ SondeView::SondeView(NavigationView& nav) { receiver_model.rf_amp(), static_cast(receiver_model.lna()), static_cast(receiver_model.vga()), - }); + }); */ // QR code with geo URI @@ -153,7 +158,8 @@ SondeView::SondeView(NavigationView& nav) { SondeView::~SondeView() { baseband::set_pitch_rssi(0, false); - radio::disable(); +/* radio::disable(); */ + receiver_model.disable(); // to switch off all, including DC bias. baseband::shutdown(); audio::output::stop(); } diff --git a/hackrf b/hackrf index 22267f3b..e6eb4ba2 160000 --- a/hackrf +++ b/hackrf @@ -1 +1 @@ -Subproject commit 22267f3b8e71bd064337921444b0e40509f47b43 +Subproject commit e6eb4ba29bbe5dc2fcd092e394188bc10a8bad54 From a11b9c492ff29ca87b3bc774d5b50c159d44553f Mon Sep 17 00:00:00 2001 From: Brumi-2021 <86470699+Brumi-2021@users.noreply.github.com> Date: Sat, 29 Jan 2022 23:29:17 +0100 Subject: [PATCH 2/4] Add_Gain_TX_to_GPS_sim_App_issue_480 Add Gain control to the GPS Sim App . (we are clonning the two previous PR's n #395 and #446 of the Replay App, correcting TX Gain control to this GPS Sim App ) --- firmware/application/apps/gps_sim_app.cpp | 20 +++++++++++++++++--- firmware/application/apps/gps_sim_app.hpp | 20 +++++++++++++++----- 2 files changed, 32 insertions(+), 8 deletions(-) diff --git a/firmware/application/apps/gps_sim_app.cpp b/firmware/application/apps/gps_sim_app.cpp index fb7babc1..f51011c9 100644 --- a/firmware/application/apps/gps_sim_app.cpp +++ b/firmware/application/apps/gps_sim_app.cpp @@ -140,13 +140,24 @@ void GpsSimAppView::start() { } ); } + field_rfgain.on_change = [this](int32_t v) { + tx_gain = v; + }; + field_rfgain.set_value(tx_gain); + receiver_model.set_tx_gain(tx_gain); + + + field_rfamp.on_change = [this](int32_t v) { + rf_amp = (bool)v; + }; + field_rfamp.set_value(rf_amp ? 14 : 0); radio::enable({ receiver_model.tuning_frequency(), sample_rate , baseband_bandwidth, rf::Direction::Transmit, - receiver_model.rf_amp(), + rf_amp, // previous code line : "receiver_model.rf_amp()," was passing the same rf_amp of all Receiver Apps static_cast(receiver_model.lna()), static_cast(receiver_model.vga()) }); @@ -181,6 +192,9 @@ GpsSimAppView::GpsSimAppView( NavigationView& nav ) : nav_ (nav) { + tx_gain = 35;field_rfgain.set_value(tx_gain); // Initial default value (-12 dB's max 47dBs ). + field_rfamp.set_value(rf_amp ? 14 : 0); // Initial default value True. (TX RF amp on , +14dB's) + baseband::run_image(portapack::spi_flash::image_tag_gps); add_children({ @@ -191,8 +205,8 @@ GpsSimAppView::GpsSimAppView( &text_duration, &progressbar, &field_frequency, - &field_lna, - &field_rf_amp, + &field_rfgain, + &field_rfamp, // let's not use common persistent rf_amp , local rfamp is enough &check_loop, &button_play, &waterfall, diff --git a/firmware/application/apps/gps_sim_app.hpp b/firmware/application/apps/gps_sim_app.hpp index 4f26c11a..34c7bb2d 100644 --- a/firmware/application/apps/gps_sim_app.hpp +++ b/firmware/application/apps/gps_sim_app.hpp @@ -52,6 +52,8 @@ private: static constexpr ui::Dim header_height = 3 * 16; uint32_t sample_rate = 0; + int32_t tx_gain { 47 }; + bool rf_amp { true }; // aux private var to store temporal, same as Replay App rf_amp user selection. static constexpr uint32_t baseband_bandwidth = 3000000; //filter bandwidth const size_t read_size { 16384 }; const size_t buffer_count { 3 }; @@ -76,7 +78,7 @@ private: bool ready_signal { false }; Labels labels { - { { 10 * 8, 2 * 16 }, "LNA: A:", Color::light_grey() } + { { 10 * 8, 2 * 16 }, "GAIN A:", Color::light_grey() } }; Button button_open { @@ -104,11 +106,19 @@ private: FrequencyField field_frequency { { 0 * 8, 2 * 16 }, }; - LNAGainField field_lna { - { 14 * 8, 2 * 16 } + NumberField field_rfgain { + { 14 * 8, 2 * 16 }, + 2, + { 0, 47 }, + 1, + ' ' }; - RFAmpField field_rf_amp { - { 19 * 8, 2 * 16 } + NumberField field_rfamp { // previously we were using "RFAmpField field_rf_amp" but that is general Receiver amp setting. + { 19 * 8, 2 * 16 }, + 2, + { 0, 14 }, // this time we will display GUI , 0 or 14 dBs same as Mic and Replay App + 14, + ' ' }; Checkbox check_loop { { 21 * 8, 2 * 16 }, From 4de25a20391906e94cf8d24763b77c846da682f5 Mon Sep 17 00:00:00 2001 From: Brumi-2021 <86470699+Brumi-2021@users.noreply.github.com> Date: Sun, 30 Jan 2022 10:58:43 +0100 Subject: [PATCH 3/4] =?UTF-8?q?Revert=20"=E2=80=9CAntenna=5FDC=5FBias=5Fmi?= =?UTF-8?q?ssing=5Fin=5FAIS=5Fand=5FRADIOSONDE=E2=80=9D"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4a57af64ce2a11d539b317637325ed78fdb75aa7. --- firmware/application/apps/ais_app.cpp | 14 ++++---------- firmware/application/apps/ui_sonde.cpp | 12 +++--------- 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/firmware/application/apps/ais_app.cpp b/firmware/application/apps/ais_app.cpp index a919ce11..7d42be86 100644 --- a/firmware/application/apps/ais_app.cpp +++ b/firmware/application/apps/ais_app.cpp @@ -307,13 +307,8 @@ AISAppView::AISAppView(NavigationView& nav) : nav_ { nav } { recent_entry_detail_view.hidden(true); target_frequency_ = initial_target_frequency; - - receiver_model.set_tuning_frequency(tuning_frequency()); - receiver_model.set_sampling_rate(sampling_rate); - receiver_model.set_baseband_bandwidth(baseband_bandwidth); - receiver_model.enable(); // Before using radio::enable(), but not updating Ant.DC-Bias. -/* radio::enable({ // this can be removed, previous version,no DC-bias control. + radio::enable({ tuning_frequency(), sampling_rate, baseband_bandwidth, @@ -321,8 +316,8 @@ AISAppView::AISAppView(NavigationView& nav) : nav_ { nav } { receiver_model.rf_amp(), static_cast(receiver_model.lna()), static_cast(receiver_model.vga()), - }); */ - + }); + options_channel.on_change = [this](size_t, OptionsField::value_t v) { this->on_frequency_changed(v); }; @@ -342,8 +337,7 @@ AISAppView::AISAppView(NavigationView& nav) : nav_ { nav } { } AISAppView::~AISAppView() { -/* radio::disable(); */ - receiver_model.disable(); // to switch off all, including DC bias. + radio::disable(); baseband::shutdown(); } diff --git a/firmware/application/apps/ui_sonde.cpp b/firmware/application/apps/ui_sonde.cpp index f38fc3dd..12da24b2 100644 --- a/firmware/application/apps/ui_sonde.cpp +++ b/firmware/application/apps/ui_sonde.cpp @@ -100,12 +100,7 @@ SondeView::SondeView(NavigationView& nav) { use_crc = v; }; - receiver_model.set_tuning_frequency(tuning_frequency()); - receiver_model.set_sampling_rate(sampling_rate); - receiver_model.set_baseband_bandwidth(baseband_bandwidth); - receiver_model.enable(); // Before using radio::enable(), but not updating Ant.DC-Bias. - - /* radio::enable({ // this can be removed, previous version, no DC-bias ant. control. + radio::enable({ tuning_frequency(), sampling_rate, baseband_bandwidth, @@ -113,7 +108,7 @@ SondeView::SondeView(NavigationView& nav) { receiver_model.rf_amp(), static_cast(receiver_model.lna()), static_cast(receiver_model.vga()), - }); */ + }); // QR code with geo URI @@ -158,8 +153,7 @@ SondeView::SondeView(NavigationView& nav) { SondeView::~SondeView() { baseband::set_pitch_rssi(0, false); -/* radio::disable(); */ - receiver_model.disable(); // to switch off all, including DC bias. + radio::disable(); baseband::shutdown(); audio::output::stop(); } From b84820963b7ff0acdff6fc43fa23ce8beb7605d9 Mon Sep 17 00:00:00 2001 From: Brumi-2021 <86470699+Brumi-2021@users.noreply.github.com> Date: Sun, 30 Jan 2022 11:37:46 +0100 Subject: [PATCH 4/4] =?UTF-8?q?Revert=20"Revert=20"=E2=80=9CAntenna=5FDC?= =?UTF-8?q?=5FBias=5Fmissing=5Fin=5FAIS=5Fand=5FRADIOSONDE=E2=80=9D""?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4de25a20391906e94cf8d24763b77c846da682f5. --- firmware/application/apps/ais_app.cpp | 14 ++++++++++---- firmware/application/apps/ui_sonde.cpp | 12 +++++++++--- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/firmware/application/apps/ais_app.cpp b/firmware/application/apps/ais_app.cpp index 7d42be86..a919ce11 100644 --- a/firmware/application/apps/ais_app.cpp +++ b/firmware/application/apps/ais_app.cpp @@ -307,8 +307,13 @@ AISAppView::AISAppView(NavigationView& nav) : nav_ { nav } { recent_entry_detail_view.hidden(true); target_frequency_ = initial_target_frequency; + + receiver_model.set_tuning_frequency(tuning_frequency()); + receiver_model.set_sampling_rate(sampling_rate); + receiver_model.set_baseband_bandwidth(baseband_bandwidth); + receiver_model.enable(); // Before using radio::enable(), but not updating Ant.DC-Bias. - radio::enable({ +/* radio::enable({ // this can be removed, previous version,no DC-bias control. tuning_frequency(), sampling_rate, baseband_bandwidth, @@ -316,8 +321,8 @@ AISAppView::AISAppView(NavigationView& nav) : nav_ { nav } { receiver_model.rf_amp(), static_cast(receiver_model.lna()), static_cast(receiver_model.vga()), - }); - + }); */ + options_channel.on_change = [this](size_t, OptionsField::value_t v) { this->on_frequency_changed(v); }; @@ -337,7 +342,8 @@ AISAppView::AISAppView(NavigationView& nav) : nav_ { nav } { } AISAppView::~AISAppView() { - radio::disable(); +/* radio::disable(); */ + receiver_model.disable(); // to switch off all, including DC bias. baseband::shutdown(); } diff --git a/firmware/application/apps/ui_sonde.cpp b/firmware/application/apps/ui_sonde.cpp index 12da24b2..f38fc3dd 100644 --- a/firmware/application/apps/ui_sonde.cpp +++ b/firmware/application/apps/ui_sonde.cpp @@ -100,7 +100,12 @@ SondeView::SondeView(NavigationView& nav) { use_crc = v; }; - radio::enable({ + receiver_model.set_tuning_frequency(tuning_frequency()); + receiver_model.set_sampling_rate(sampling_rate); + receiver_model.set_baseband_bandwidth(baseband_bandwidth); + receiver_model.enable(); // Before using radio::enable(), but not updating Ant.DC-Bias. + + /* radio::enable({ // this can be removed, previous version, no DC-bias ant. control. tuning_frequency(), sampling_rate, baseband_bandwidth, @@ -108,7 +113,7 @@ SondeView::SondeView(NavigationView& nav) { receiver_model.rf_amp(), static_cast(receiver_model.lna()), static_cast(receiver_model.vga()), - }); + }); */ // QR code with geo URI @@ -153,7 +158,8 @@ SondeView::SondeView(NavigationView& nav) { SondeView::~SondeView() { baseband::set_pitch_rssi(0, false); - radio::disable(); +/* radio::disable(); */ + receiver_model.disable(); // to switch off all, including DC bias. baseband::shutdown(); audio::output::stop(); }