Skip to content

Commit

Permalink
Record button remove (#968)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
gullradriel committed May 10, 2023
1 parent 909b00b commit 9a22a76
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 83 deletions.
28 changes: 14 additions & 14 deletions firmware/application/apps/pocsag_app.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ class POCSAGAppView : public View {
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 { };

Expand All @@ -91,13 +91,7 @@ class POCSAGAppView : public View {
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 },
Expand All @@ -106,16 +100,22 @@ class POCSAGAppView : public View {
};

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 }
Expand Down
23 changes: 11 additions & 12 deletions firmware/application/apps/ui_afsk_rx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ AFSKRxView::AFSKRxView(NavigationView& nav) {
&field_lna,
&field_vga,
&field_frequency,
&check_log,
&text_debug,
&button_modem_setup,
&record_view,
&console
});

Expand All @@ -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];
Expand All @@ -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<ModemSetupView>();
};
Expand Down Expand Up @@ -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));
}
}

Expand Down
21 changes: 11 additions & 10 deletions firmware/application/apps/ui_afsk_rx.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class AFSKRxView : public View {
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 }
Expand All @@ -85,23 +86,23 @@ class AFSKRxView : public View {
{ 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 }
};
Expand Down
10 changes: 0 additions & 10 deletions firmware/application/apps/ui_btle_rx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ BTLERxView::BTLERxView(NavigationView& nav) {
&field_lna,
&field_vga,
&field_frequency,
&text_debug,
&button_modem_setup,
&record_view,
&console
});

Expand All @@ -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];
Expand Down Expand Up @@ -103,7 +94,6 @@ BTLERxView::BTLERxView(NavigationView& nav) {
nav.push<ModemSetupView>();
};


// Auto-configure modem for LCR RX (will be removed later)
baseband::set_btle(persistent_memory::modem_baudrate(), 8, 0, false);

Expand Down
15 changes: 1 addition & 14 deletions firmware/application/apps/ui_btle_rx.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ class BTLERxView : public View {

uint8_t console_color { 0 };
uint32_t prev_value { 0 };
std::string str_log { "" };

RFAmpField field_rf_amp {
{ 13 * 8, 0 * 16 }
Expand All @@ -75,23 +74,11 @@ class BTLERxView : public View {
{ 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 }
};
Expand Down
8 changes: 0 additions & 8 deletions firmware/application/apps/ui_nrf_rx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ NRFRxView::NRFRxView(NavigationView& nav) {
&field_lna,
&field_vga,
&field_frequency,
&text_debug,
&button_modem_setup,
&record_view,
&console
});

Expand All @@ -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];
Expand Down
15 changes: 1 addition & 14 deletions firmware/application/apps/ui_nrf_rx.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ class NRFRxView : public View {

uint8_t console_color { 0 };
uint32_t prev_value { 0 };
std::string str_log { "" };

RFAmpField field_rf_amp {
{ 13 * 8, 0 * 16 }
Expand All @@ -74,23 +73,11 @@ class NRFRxView : public View {
{ 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 }
};
Expand Down
2 changes: 1 addition & 1 deletion firmware/baseband/proc_siggen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
}
Expand Down

0 comments on commit 9a22a76

Please sign in to comment.