From a7acb37a563415f0ee0bc85b785a9a9014edc7d2 Mon Sep 17 00:00:00 2001 From: GullCode Date: Mon, 13 Mar 2023 14:02:29 +0100 Subject: [PATCH 1/3] added 0.1 and 1Khz steps --- firmware/application/freqman.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/firmware/application/freqman.cpp b/firmware/application/freqman.cpp index 467782e3..413388c3 100644 --- a/firmware/application/freqman.cpp +++ b/firmware/application/freqman.cpp @@ -51,6 +51,8 @@ options_t freqman_entry_bandwidths[ 4 ] = { }; options_t freqman_entry_steps = { + { "0.1KHz " , 100 }, + { "1KHz " , 1000 }, { "5KHz (SA AM)" , 5000 }, { "6.25KHz(NFM)" , 6250 }, { "8.33KHz(AIR)" , 8330 }, @@ -68,6 +70,8 @@ options_t freqman_entry_steps = { }; options_t freqman_entry_steps_short = { + { "0.1KHz" , 100 }, + { "1KHz" , 1000 }, { "5KHz" , 5000 }, { "6.25KHz" , 6250 }, { "8.33KHz" , 8330 }, From f42812c6b4f29fa9656fd56ad7e913289e91d8ec Mon Sep 17 00:00:00 2001 From: GullCode Date: Mon, 13 Mar 2023 14:03:37 +0100 Subject: [PATCH 2/3] Added rssi get_delta, better rssi min graph view --- firmware/application/ui/ui_rssi.cpp | 19 ++++++++++++++----- firmware/application/ui/ui_rssi.hpp | 1 + 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/firmware/application/ui/ui_rssi.cpp b/firmware/application/ui/ui_rssi.cpp index 674279da..8c4f483a 100644 --- a/firmware/application/ui/ui_rssi.cpp +++ b/firmware/application/ui/ui_rssi.cpp @@ -36,10 +36,11 @@ namespace ui { const auto r = screen_rect(); constexpr int rssi_sample_range = 256; - constexpr float rssi_voltage_min = 0.4; + //constexpr float rssi_voltage_min = 0.4; constexpr float rssi_voltage_max = 2.2; constexpr float adc_voltage_max = 3.3; - constexpr int raw_min = rssi_sample_range * rssi_voltage_min / adc_voltage_max; + //constexpr int raw_min = rssi_sample_range * rssi_voltage_min / adc_voltage_max; + constexpr int raw_min = 0 ; constexpr int raw_max = rssi_sample_range * rssi_voltage_max / adc_voltage_max; constexpr int raw_delta = raw_max - raw_min; @@ -178,6 +179,12 @@ namespace ui { return max_ ; } + int32_t RSSI::get_delta() + { + return max_ - min_ ; + } + + void RSSI::set_pitch_rssi(bool enabled) { pitch_rssi_enabled = enabled; if (!enabled) baseband::set_pitch_rssi(0, false); @@ -272,7 +279,7 @@ namespace ui { painter.draw_vline( p4, width_y, - Color::green()); + Color::green() ); } } @@ -281,10 +288,11 @@ namespace ui { const auto r = screen_rect(); constexpr int rssi_sample_range = 256; - constexpr float rssi_voltage_min = 0.4; + //constexpr float rssi_voltage_min = 0.4; constexpr float rssi_voltage_max = 2.2; constexpr float adc_voltage_max = 3.3; - constexpr int raw_min = rssi_sample_range * rssi_voltage_min / adc_voltage_max; + //constexpr int raw_min = rssi_sample_range * rssi_voltage_min / adc_voltage_max; + constexpr int raw_min = 0 ; constexpr int raw_max = rssi_sample_range * rssi_voltage_max / adc_voltage_max; constexpr int raw_delta = raw_max - raw_min; @@ -308,4 +316,5 @@ namespace ui { } set_dirty(); } + } /* namespace ui */ diff --git a/firmware/application/ui/ui_rssi.hpp b/firmware/application/ui/ui_rssi.hpp index f7783529..f3062e44 100644 --- a/firmware/application/ui/ui_rssi.hpp +++ b/firmware/application/ui/ui_rssi.hpp @@ -49,6 +49,7 @@ public: int32_t get_min(); int32_t get_avg(); int32_t get_max(); + int32_t get_delta(); void set_vertical_rssi(bool enabled); void set_peak(bool enabled, size_t duration); From 37494500b25943043b4a5781c31334330495e176 Mon Sep 17 00:00:00 2001 From: GullCode Date: Mon, 13 Mar 2023 14:04:23 +0100 Subject: [PATCH 3/3] Added display of rssi get delta, swapped audio and steps button for convenience --- firmware/application/apps/ui_level.cpp | 2 +- firmware/application/apps/ui_level.hpp | 18 ++++++++---------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/firmware/application/apps/ui_level.cpp b/firmware/application/apps/ui_level.cpp index 2c5e2a42..51cb98cc 100644 --- a/firmware/application/apps/ui_level.cpp +++ b/firmware/application/apps/ui_level.cpp @@ -215,7 +215,7 @@ namespace ui { last_min_rssi = rssi.get_min(); last_avg_rssi = rssi.get_avg(); last_max_rssi = rssi.get_max(); - freq_stats_rssi.set( "RSSI: "+to_string_dec_int( rssi.get_min() )+"/"+to_string_dec_int( rssi.get_avg() )+"/"+to_string_dec_int( rssi.get_max() )+" db" ); + freq_stats_rssi.set( "RSSI: "+to_string_dec_int( rssi.get_min() )+"/"+to_string_dec_int( rssi.get_avg() )+"/"+to_string_dec_int( rssi.get_max() )+" db, dt: "+to_string_dec_int( rssi.get_delta() )+" db" ); } } /* on_statistic_updates */ diff --git a/firmware/application/apps/ui_level.hpp b/firmware/application/apps/ui_level.hpp index 25473e4d..e4c573bd 100644 --- a/firmware/application/apps/ui_level.hpp +++ b/firmware/application/apps/ui_level.hpp @@ -47,10 +47,8 @@ namespace ui { ~LevelView(); void focus() override; - - void big_display_freq( int64_t f ); - void on_audio_spectrum(const AudioSpectrum* spectrum); + void big_display_freq( int64_t f ); const Style style_grey { // level .font = font::fixed_8x16, @@ -143,18 +141,18 @@ namespace ui { }; OptionsField step_mode { - { 21 * 8, 1 * 16 }, + { 16 * 8, 2 * 16 + 4 }, 12, { } }; - + RSSIGraph rssi_graph { // 240x320 => - { 0 , 5 * 16 + 4 , 240 - 5 * 8 , 320 - 5 * 16 - 4 }, + { 0 , 5 * 16 + 4 , 240 - 5 * 8 , 216 }, }; - RSSI rssi { // 240x320 => - { 240 - 5 * 8 , 5 * 16 + 4 , 5 * 8 , 320 - 5 * 16 - 4 }, + RSSI rssi { // 240x320 => + { 240 - 5 * 8 , 5 * 16 + 4 , 5 * 8 , 216 }, }; @@ -164,7 +162,7 @@ namespace ui { }; OptionsField audio_mode { - { 16 * 8, 2 * 16 + 4 }, + { 21 * 8, 1 * 16 }, 9, { {"audio off", 0}, @@ -188,7 +186,7 @@ namespace ui { { 0 * 8 , 4 * 16 + 4 , 15 * 8, 16 }, }; - + OptionsField peak_mode { { 44 + 10 * 8, 4 * 16 + 4 }, 10,