From 0c68b74fc8348f847a92d946fba87ffcfa6965c8 Mon Sep 17 00:00:00 2001 From: erikkaashoek Date: Tue, 3 May 2022 17:15:42 +0200 Subject: [PATCH] Solved drop at start after resume --- main.c | 3 ++- sa_core.c | 9 ++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index e15b87d..6200f56 100644 --- a/main.c +++ b/main.c @@ -372,7 +372,8 @@ VNA_SHELL_FUNCTION(cmd_resume) (void)argv; uint16_t c = 0; // restore frequencies array and cal - update_frequencies(); + // if (dirty) + update_frequencies(); if (argc == 1) { c = my_atoi(argv[0]); resume_once(c) ; diff --git a/sa_core.c b/sa_core.c index 8c1d444..8376b67 100644 --- a/sa_core.c +++ b/sa_core.c @@ -757,8 +757,8 @@ void set_IF2(int f) { config.frequency_IF2 = f; - dirty = true; config_save(); + dirty = true; } void set_R(int f) @@ -3934,11 +3934,15 @@ again: // Spur redu #ifdef __SI4432__ if (i == 0 && setting.frequency_step == 0 && setting.trigger == T_AUTO && S_STATE(setting.spur_removal) == 0 && SI4432_step_delay == 0 && setting.repeat == 1 && setting.sweep_time_us < 100*ONE_MS_TIME) { // if ultra fast scanning is needed prefill the SI4432 RSSI read buffer + if (scandirty) + my_microsecond_delay(6400); // Extra time to avoid gap when filling SI4468 SI4432_Fill(MODE_SELECT(setting.mode), 0); } #endif #ifdef __SI4463__ if (i == 0 && setting.frequency_step == 0 && setting.trigger == T_AUTO && S_STATE(setting.spur_removal) == 0 && SI4432_step_delay == 0 && setting.repeat == 1 && setting.sweep_time_us < 100*ONE_MS_TIME && setting.exp_aver == 1) { + if (scandirty) + my_microsecond_delay(16000); // Extra time to avoid gap when filling SI4468 SI446x_Fill(MODE_SELECT(setting.mode), -1); // First get_RSSI will fail } #endif @@ -4015,6 +4019,9 @@ again: // Spur redu } #endif #ifdef __SI4463__ + if (scandirty) + my_microsecond_delay(10000); // Extra time to avoid gap when filling SI4468 + if (/* S_STATE(setting.spur_removal) == 0 && */ SI4432_step_delay == 0 && setting.repeat == 1 && setting.sweep_time_us < 100*ONE_MS_TIME) { SI446x_Fill(MODE_SELECT(setting.mode), 1); // fast mode possible to pre-fill RSSI buffer }