mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-05-06 12:06:50 +00:00
fix timer and sd settings issue (#1291)
This commit is contained in:
parent
bee2dc17af
commit
3b5890d0aa
@ -192,7 +192,7 @@ bool ReconView::recon_load_config_from_sd() {
|
|||||||
parse_int(line, recon_match_mode);
|
parse_int(line, recon_match_mode);
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
parse_int(line, recon_match_mode);
|
parse_int(line, wait);
|
||||||
complete = true; // NB: Last entry.
|
complete = true; // NB: Last entry.
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -890,7 +890,6 @@ void ReconView::on_statistics_update(const ChannelStatistics& statistics) {
|
|||||||
if (recon) {
|
if (recon) {
|
||||||
if (!timer) {
|
if (!timer) {
|
||||||
status = 0;
|
status = 0;
|
||||||
continuous_lock = false;
|
|
||||||
freq_lock = 0;
|
freq_lock = 0;
|
||||||
timer = local_recon_lock_duration;
|
timer = local_recon_lock_duration;
|
||||||
big_display.set_style(&Styles::white);
|
big_display.set_style(&Styles::white);
|
||||||
@ -907,22 +906,19 @@ void ReconView::on_statistics_update(const ChannelStatistics& statistics) {
|
|||||||
}
|
}
|
||||||
if (db > squelch) // MATCHING LEVEL
|
if (db > squelch) // MATCHING LEVEL
|
||||||
{
|
{
|
||||||
continuous_lock = true;
|
|
||||||
freq_lock++;
|
freq_lock++;
|
||||||
|
timer += time_interval; // give some more time for next lock
|
||||||
} else {
|
} else {
|
||||||
// continuous, direct cut it if not consecutive match after 1 first match
|
// continuous, direct cut it if not consecutive match after 1 first match
|
||||||
if (recon_match_mode == RECON_MATCH_CONTINUOUS) {
|
if (recon_match_mode == RECON_MATCH_CONTINUOUS) {
|
||||||
if (freq_lock > 0) {
|
freq_lock = 0;
|
||||||
timer = 0;
|
timer = 0;
|
||||||
continuous_lock = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (freq_lock >= recon_lock_nb_match) // LOCKED
|
if (freq_lock >= recon_lock_nb_match) // LOCKED
|
||||||
{
|
{
|
||||||
if (status != 2) {
|
if (status != 2) {
|
||||||
continuous_lock = false;
|
|
||||||
status = 2;
|
status = 2;
|
||||||
// FREQ IS STRONG: GREEN and recon will pause when on_statistics_update()
|
// FREQ IS STRONG: GREEN and recon will pause when on_statistics_update()
|
||||||
if ((!scanner_mode) && autosave && frequency_list.size() > 0) {
|
if ((!scanner_mode) && autosave && frequency_list.size() > 0) {
|
||||||
@ -963,10 +959,9 @@ void ReconView::on_statistics_update(const ChannelStatistics& statistics) {
|
|||||||
last_timer = timer;
|
last_timer = timer;
|
||||||
text_timer.set("TIMER: " + to_string_dec_int(timer));
|
text_timer.set("TIMER: " + to_string_dec_int(timer));
|
||||||
}
|
}
|
||||||
if (timer) {
|
|
||||||
if (!continuous_lock || recon_match_mode == RECON_MATCH_SPARSE) {
|
if (timer != 0) {
|
||||||
timer -= time_interval;
|
timer -= time_interval;
|
||||||
}
|
|
||||||
if (timer < 0) {
|
if (timer < 0) {
|
||||||
timer = 0;
|
timer = 0;
|
||||||
}
|
}
|
||||||
@ -1126,7 +1121,6 @@ void ReconView::on_statistics_update(const ChannelStatistics& statistics) {
|
|||||||
void ReconView::recon_pause() {
|
void ReconView::recon_pause() {
|
||||||
timer = 0;
|
timer = 0;
|
||||||
freq_lock = 0;
|
freq_lock = 0;
|
||||||
continuous_lock = false;
|
|
||||||
recon = false;
|
recon = false;
|
||||||
|
|
||||||
if (field_mode.selected_index_value() != SPEC_MODULATION)
|
if (field_mode.selected_index_value() != SPEC_MODULATION)
|
||||||
@ -1139,7 +1133,6 @@ void ReconView::recon_pause() {
|
|||||||
void ReconView::recon_resume() {
|
void ReconView::recon_resume() {
|
||||||
timer = 0;
|
timer = 0;
|
||||||
freq_lock = 0;
|
freq_lock = 0;
|
||||||
continuous_lock = false;
|
|
||||||
recon = true;
|
recon = true;
|
||||||
|
|
||||||
if (field_mode.selected_index_value() != SPEC_MODULATION)
|
if (field_mode.selected_index_value() != SPEC_MODULATION)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user