diff --git a/sa_core.c b/sa_core.c index f6b5827..1db339a 100644 --- a/sa_core.c +++ b/sa_core.c @@ -3765,6 +3765,16 @@ pureRSSI_t perform(bool break_on_operation, int i, freq_t f, int tracking) / update_rbw(); calculate_step_delay(); scandirty = true; // This is the first pass with new settings +#ifdef __FAST_SWEEP__ + // A zero span reader that stopped early (scanraw with fewer points, an abort) left RSSI + // samples of its own frequency and RBW in the buffer, the next reads would return them +#ifdef __SI4432__ + SI4432_Fill_clear(); +#endif +#ifdef __SI4463__ + SI446x_Fill_clear(); +#endif +#endif // Set for actual time pre calculated value (update after sweep) setting.actual_sweep_time_us = calc_min_sweep_time_us(); // Change actual sweep time as user input if it greater minimum diff --git a/si4432.c b/si4432.c index 2661a02..56e568d 100644 --- a/si4432.c +++ b/si4432.c @@ -709,6 +709,11 @@ void SI4432_Fill(int s, int start) buf_end = sweep_points - 1; buf_read = true; } + +void SI4432_Fill_clear(void) // drop the samples a zero span reader did not use +{ + buf_read = false; +} #endif #ifdef __LISTEN__ diff --git a/si4432.h b/si4432.h index 5105ca9..deeebce 100644 --- a/si4432.h +++ b/si4432.h @@ -140,6 +140,7 @@ uint16_t set_rbw(uint16_t WISH); void set_calibration_freq(int freq); #ifdef __FAST_SWEEP__ void SI4432_Fill(int s, int start); +void SI4432_Fill_clear(void); void SI4432_trigger_fill(int s, uint8_t trigger_lvl, int up_direction, int trigger_mode); #if 0 int SI4432_is_fast_mode(void); @@ -194,6 +195,7 @@ extern si446x_info_t SI4463_info; pureRSSI_t getSI4463_RSSI_correction(void); void Si446x_getInfo(si446x_info_t* info); void SI446x_Fill(int s, int start); +void SI446x_Fill_clear(void); void SI446x_trigger_fill(int s, uint8_t trigger_lvl, int up_direction, int trigger_mode); void SI4463_init(void); void set_calibration_freq(int freq); diff --git a/si4468.c b/si4468.c index 8a8335c..3198f95 100644 --- a/si4468.c +++ b/si4468.c @@ -2205,6 +2205,11 @@ void SI446x_Fill(int s, int start) buf_end = sweep_points - 1; buf_read = true; } + +void SI446x_Fill_clear(void) // drop the samples a zero span reader did not use +{ + buf_read = false; +} #endif #ifdef __LISTEN__