From 9200611124ac83b8017355ce75d9fa66e1d13de1 Mon Sep 17 00:00:00 2001 From: erikkaashoek Date: Thu, 2 Jul 2020 10:09:26 +0200 Subject: [PATCH 1/3] Prevent unneeded updating of status panel --- sa_core.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sa_core.c b/sa_core.c index d5b4c87..ba0d32d 100644 --- a/sa_core.c +++ b/sa_core.c @@ -2340,6 +2340,10 @@ void draw_cal_status(void) ili9341_drawstring(buf, x, y); #if 1 y += YSTEP; + int old_dirty = dirty; + update_rbw(); // To ensure the calc_min_sweep time shown takes the latest delay into account + calculate_step_delay(); + dirty = old_dirty; // restore as update_rbw sets dirty uint32_t t = calc_min_sweep_time_us(); // if (t < setting.sweep_time_us) // t = setting.sweep_time_us; From 7bc613b914c2b13c656a13459be5312cfb6b0664 Mon Sep 17 00:00:00 2001 From: erikkaashoek Date: Thu, 2 Jul 2020 10:39:17 +0200 Subject: [PATCH 2/3] Set offset delay to safe value --- sa_core.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sa_core.c b/sa_core.c index ba0d32d..e39eccf 100644 --- a/sa_core.c +++ b/sa_core.c @@ -796,10 +796,10 @@ void calculate_step_delay(void) if (setting.frequency_step == 0.0) { // zero span mode, not dependent on selected RBW SI4432_step_delay = 0; } else { - if (actual_rbw_x10 >= 1910) SI4432_step_delay = 280; - else if (actual_rbw_x10 >= 1420) SI4432_step_delay = 350; - else if (actual_rbw_x10 >= 750) SI4432_step_delay = 450; - else if (actual_rbw_x10 >= 560) SI4432_step_delay = 650; + if (actual_rbw_x10 >= 1910) { SI4432_step_delay = 280; SI4432_offset_delay = 200; } + else if (actual_rbw_x10 >= 1420) { SI4432_step_delay = 350; SI4432_offset_delay = 200; } + else if (actual_rbw_x10 >= 750) { SI4432_step_delay = 450; SI4432_offset_delay = 200; } + else if (actual_rbw_x10 >= 560) { SI4432_step_delay = 650; SI4432_offset_delay = 200; } else if (actual_rbw_x10 >= 370) { SI4432_step_delay = 700; SI4432_offset_delay = 200; } else if (actual_rbw_x10 >= 180) { SI4432_step_delay = 1100; SI4432_offset_delay = 250; } else if (actual_rbw_x10 >= 90) { SI4432_step_delay = 1700; SI4432_offset_delay = 400; } From a2eead2d5d735b74c45f030919e3644e93b22390 Mon Sep 17 00:00:00 2001 From: erikkaashoek Date: Thu, 2 Jul 2020 16:53:47 +0200 Subject: [PATCH 3/3] Correct sweep time measurement when triggering is active in slow CW mode --- sa_core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sa_core.c b/sa_core.c index e39eccf..df2ffb2 100644 --- a/sa_core.c +++ b/sa_core.c @@ -1535,6 +1535,7 @@ float perform(bool break_on_operation, int i, uint32_t f, int tracking) // M break; // abort if (subRSSI < setting.trigger_level) // trigger level not yet reached goto wait; // get next rssi + start_of_sweep_timestamp = chVTGetSystemTimeX(); // Actually one sample to late #ifdef __FAST_SWEEP__ if (i == 0 && setting.frequency_step == 0 /* && setting.trigger == T_AUTO */&& setting.spur == 0 && old_actual_step_delay == 0 && setting.repeat == 1 && setting.sweep_time_us < ONE_SECOND_TIME) {