From 9a22a760ad7b1d30b6040b2aa3e6e4f9c4bcd943 Mon Sep 17 00:00:00 2001 From: gullradriel <3157857+gullradriel@users.noreply.github.com> Date: Wed, 10 May 2023 14:12:49 +0200 Subject: [PATCH] Record button remove (#968) * removed unused debug and record buttons * added log checkbox * changed ignore and log to false at app start for pocsag * fixed warning: suggest parentheses around arithmetic in operand of '^' proc signal * ui comsetic fix --- firmware/application/apps/pocsag_app.hpp | 28 ++++++++++++------------ firmware/application/apps/ui_afsk_rx.cpp | 23 ++++++++++--------- firmware/application/apps/ui_afsk_rx.hpp | 21 +++++++++--------- firmware/application/apps/ui_btle_rx.cpp | 10 --------- firmware/application/apps/ui_btle_rx.hpp | 15 +------------ firmware/application/apps/ui_nrf_rx.cpp | 8 ------- firmware/application/apps/ui_nrf_rx.hpp | 15 +------------ firmware/baseband/proc_siggen.cpp | 2 +- 8 files changed, 39 insertions(+), 83 deletions(-) diff --git a/firmware/application/apps/pocsag_app.hpp b/firmware/application/apps/pocsag_app.hpp index 8ea3c4b9..48437cd6 100644 --- a/firmware/application/apps/pocsag_app.hpp +++ b/firmware/application/apps/pocsag_app.hpp @@ -64,8 +64,8 @@ private: std::app_settings settings { }; std::app_settings::AppSettings app_settings { }; - bool logging { true }; - bool ignore { true }; + bool logging { false }; + bool ignore { false }; uint32_t last_address = 0xFFFFFFFF; pocsag::POCSAGState pocsag_state { }; @@ -91,13 +91,7 @@ private: FrequencyField field_frequency { { 0 * 8, 0 * 8 }, }; - Checkbox check_log { - { 24 * 8, 21 }, - 3, - "LOG", - true - }; - NumberField field_volume{ + NumberField field_volume{ { 28 * 8, 0 * 16 }, 2, { 0, 99 }, @@ -106,16 +100,22 @@ private: }; Checkbox check_ignore { - { 1 * 8, 21 }, - 12, - "Ignore addr:", - true + { 0 * 8, 21 }, + 8, + "Ign addr", + false }; SymField sym_ignore { - { 16 * 8, 21 }, + { 13 * 8, 25 }, 7, SymField::SYMFIELD_DEC }; + Checkbox check_log { + { 240 - 8 * 8, 21 }, + 3, + "LOG", + false + }; Console console { { 0, 3 * 16, 240, 256 } diff --git a/firmware/application/apps/ui_afsk_rx.cpp b/firmware/application/apps/ui_afsk_rx.cpp index 54792f57..e8daa261 100644 --- a/firmware/application/apps/ui_afsk_rx.cpp +++ b/firmware/application/apps/ui_afsk_rx.cpp @@ -60,9 +60,9 @@ AFSKRxView::AFSKRxView(NavigationView& nav) { &field_lna, &field_vga, &field_frequency, + &check_log, &text_debug, &button_modem_setup, - &record_view, &console }); @@ -74,13 +74,6 @@ AFSKRxView::AFSKRxView(NavigationView& nav) { field_rf_amp.set_value(app_settings.rx_amp); } - - // DEBUG - record_view.on_error = [&nav](std::string message) { - nav.display_modal("Error", message); - }; - record_view.set_sampling_rate(24000); - // Auto-configure modem for LCR RX (will be removed later) update_freq(467225500); // 462713300 auto def_bell202 = &modem_defs[0]; @@ -105,6 +98,11 @@ AFSKRxView::AFSKRxView(NavigationView& nav) { }; }; + check_log.set_value(logging); + check_log.on_select = [this](Checkbox&, bool v) { + logging = v; + }; + button_modem_setup.on_select = [&nav](Button&) { nav.push(); }; @@ -153,22 +151,23 @@ void AFSKRxView::on_data(uint32_t value, bool is_data) { console.write(str_console); - if (logger) str_log += str_byte; + if (logger && logging) str_log += str_byte; if ((value != 0x7F) && (prev_value == 0x7F)) { // Message split console.writeln(""); console_color++; - if (logger) { + if (logger && logging) { logger->log_raw_data(str_log); str_log = ""; } } prev_value = value; - } else { + } + else { // Baudrate estimation - text_debug.set("~" + to_string_dec_uint(value)); + text_debug.set("Baudrate estimation: ~" + to_string_dec_uint(value)); } } diff --git a/firmware/application/apps/ui_afsk_rx.hpp b/firmware/application/apps/ui_afsk_rx.hpp index cef19af1..455f5b45 100644 --- a/firmware/application/apps/ui_afsk_rx.hpp +++ b/firmware/application/apps/ui_afsk_rx.hpp @@ -64,6 +64,7 @@ private: uint8_t console_color { 0 }; uint32_t prev_value { 0 }; std::string str_log { "" }; + bool logging { false }; RFAmpField field_rf_amp { { 13 * 8, 0 * 16 } @@ -85,23 +86,23 @@ private: { 0 * 8, 0 * 16 }, }; - Text text_debug { - { 0 * 8, 1 * 16, 10 * 8, 16 }, + Checkbox check_log { + { 0 * 8, 1 * 16 }, + 3, + "LOG", + false + }; + + Text text_debug { + { 0 * 8, 12 + 2 * 16, 240, 16 }, "DEBUG" }; - Button button_modem_setup { - { 12 * 8, 1 * 16, 96, 24 }, + { 240 - 12 * 8, 1 * 16, 96, 24 }, "Modem setup" }; - // DEBUG - RecordView record_view { - { 0 * 8, 3 * 16, 30 * 8, 1 * 16 }, - u"AFS_????", RecordView::FileType::WAV, 4096, 4 - }; - Console console { { 0, 4 * 16, 240, 240 } }; diff --git a/firmware/application/apps/ui_btle_rx.cpp b/firmware/application/apps/ui_btle_rx.cpp index 226f9dc1..082a016a 100644 --- a/firmware/application/apps/ui_btle_rx.cpp +++ b/firmware/application/apps/ui_btle_rx.cpp @@ -54,9 +54,7 @@ BTLERxView::BTLERxView(NavigationView& nav) { &field_lna, &field_vga, &field_frequency, - &text_debug, &button_modem_setup, - &record_view, &console }); @@ -68,13 +66,6 @@ BTLERxView::BTLERxView(NavigationView& nav) { field_rf_amp.set_value(app_settings.rx_amp); } - - // DEBUG - record_view.on_error = [&nav](std::string message) { - nav.display_modal("Error", message); - }; - record_view.set_sampling_rate(24000); - // Auto-configure modem for LCR RX (will be removed later) update_freq(2426000000); auto def_bell202 = &modem_defs[0]; @@ -103,7 +94,6 @@ BTLERxView::BTLERxView(NavigationView& nav) { nav.push(); }; - // Auto-configure modem for LCR RX (will be removed later) baseband::set_btle(persistent_memory::modem_baudrate(), 8, 0, false); diff --git a/firmware/application/apps/ui_btle_rx.hpp b/firmware/application/apps/ui_btle_rx.hpp index 91bf0710..088661a2 100644 --- a/firmware/application/apps/ui_btle_rx.hpp +++ b/firmware/application/apps/ui_btle_rx.hpp @@ -53,7 +53,6 @@ private: uint8_t console_color { 0 }; uint32_t prev_value { 0 }; - std::string str_log { "" }; RFAmpField field_rf_amp { { 13 * 8, 0 * 16 } @@ -75,23 +74,11 @@ private: { 0 * 8, 0 * 16 }, }; - Text text_debug { - { 0 * 8, 1 * 16, 10 * 8, 16 }, - "DEBUG" - }; - - Button button_modem_setup { - { 12 * 8, 1 * 16, 96, 24 }, + { 240 - 12 * 8, 1 * 16, 96, 24 }, "Modem setup" }; - // DEBUG - RecordView record_view { - { 0 * 8, 3 * 16, 30 * 8, 1 * 16 }, - u"AFS_????", RecordView::FileType::WAV, 4096, 4 - }; - Console console { { 0, 4 * 16, 240, 240 } }; diff --git a/firmware/application/apps/ui_nrf_rx.cpp b/firmware/application/apps/ui_nrf_rx.cpp index d5d916f8..3af8d1d1 100644 --- a/firmware/application/apps/ui_nrf_rx.cpp +++ b/firmware/application/apps/ui_nrf_rx.cpp @@ -54,9 +54,7 @@ NRFRxView::NRFRxView(NavigationView& nav) { &field_lna, &field_vga, &field_frequency, - &text_debug, &button_modem_setup, - &record_view, &console }); @@ -68,12 +66,6 @@ NRFRxView::NRFRxView(NavigationView& nav) { field_rf_amp.set_value(app_settings.rx_amp); } - // DEBUG - record_view.on_error = [&nav](std::string message) { - nav.display_modal("Error", message); - }; - record_view.set_sampling_rate(24000); - // Auto-configure modem for LCR RX (will be removed later) update_freq(2480000000); auto def_bell202 = &modem_defs[0]; diff --git a/firmware/application/apps/ui_nrf_rx.hpp b/firmware/application/apps/ui_nrf_rx.hpp index 18a6f814..fdf04977 100644 --- a/firmware/application/apps/ui_nrf_rx.hpp +++ b/firmware/application/apps/ui_nrf_rx.hpp @@ -52,7 +52,6 @@ private: uint8_t console_color { 0 }; uint32_t prev_value { 0 }; - std::string str_log { "" }; RFAmpField field_rf_amp { { 13 * 8, 0 * 16 } @@ -74,23 +73,11 @@ private: { 0 * 8, 0 * 16 }, }; - Text text_debug { - { 0 * 8, 1 * 16, 10 * 8, 16 }, - "DEBUG" - }; - - Button button_modem_setup { - { 12 * 8, 1 * 16, 96, 24 }, + { 240 - 12 * 8, 1 * 16, 96, 24 }, "Modem setup" }; - // DEBUG - RecordView record_view { - { 0 * 8, 3 * 16, 30 * 8, 1 * 16 }, - u"AFS_????", RecordView::FileType::WAV, 4096, 4 - }; - Console console { { 0, 4 * 16, 240, 240 } }; diff --git a/firmware/baseband/proc_siggen.cpp b/firmware/baseband/proc_siggen.cpp index ea796301..a2570aa9 100644 --- a/firmware/baseband/proc_siggen.cpp +++ b/firmware/baseband/proc_siggen.cpp @@ -67,7 +67,7 @@ void SigGenProcessor::execute(const buffer_c8_t& buffer) { // 16 bits LFSR .taps: 16, 15, 13, 4 ;feedback polynomial: x^16 + x^15 + x^13 + x^4 + 1 // Periode 65535= 2^n-1, quite continuous . if (counter == 0) { // we slow down the shift register, because the pseudo random noise clock freq was too high for modulator. - bit_16 = ((lfsr_16 >> 0) ^ (lfsr_16 >> 1) ^ (lfsr_16 >> 3) ^ (lfsr_16 >> 4) ^ (lfsr_16 >> 12) & 1); + bit_16 = ((lfsr_16 >> 0) ^ (lfsr_16 >> 1) ^ (lfsr_16 >> 3) ^ (lfsr_16 >> 4) ^ ((lfsr_16 >> 12) & 1) ); lfsr_16 = (lfsr_16 >> 1) | (bit_16 << 15); sample = (lfsr_16 & 0x00FF); // main pseudo random noise generator. }