mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2024-12-13 03:34:35 +00:00
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
This commit is contained in:
parent
909b00bdae
commit
9a22a760ad
@ -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,12 +91,6 @@ private:
|
||||
FrequencyField field_frequency {
|
||||
{ 0 * 8, 0 * 8 },
|
||||
};
|
||||
Checkbox check_log {
|
||||
{ 24 * 8, 21 },
|
||||
3,
|
||||
"LOG",
|
||||
true
|
||||
};
|
||||
NumberField field_volume{
|
||||
{ 28 * 8, 0 * 16 },
|
||||
2,
|
||||
@ -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 }
|
||||
|
@ -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<ModemSetupView>();
|
||||
};
|
||||
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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 },
|
||||
};
|
||||
|
||||
Checkbox check_log {
|
||||
{ 0 * 8, 1 * 16 },
|
||||
3,
|
||||
"LOG",
|
||||
false
|
||||
};
|
||||
|
||||
Text text_debug {
|
||||
{ 0 * 8, 1 * 16, 10 * 8, 16 },
|
||||
{ 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 }
|
||||
};
|
||||
|
@ -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<ModemSetupView>();
|
||||
};
|
||||
|
||||
|
||||
// Auto-configure modem for LCR RX (will be removed later)
|
||||
baseband::set_btle(persistent_memory::modem_baudrate(), 8, 0, false);
|
||||
|
||||
|
@ -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 }
|
||||
};
|
||||
|
@ -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];
|
||||
|
@ -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 }
|
||||
};
|
||||
|
@ -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.
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user