Zero span: drop RSSI samples left in the buffer at a new setup

The zero span fill measures sweep_points RSSI samples and the following
reads return them until the buffer is used up. A reader that stopped early,
such as scanraw with fewer points than the sweep or an aborted sweep, left
samples of its frequency and RBW behind, and the next scanraw or sweep
returned them for its first points (a 29-31 MHz scanraw after a 290 point
zero span scanraw showed the noise of a 600 kHz RBW at 30 MHz). The first
point after a change of settings or frequency step now clears them.
main
erikkaashoek 2 weeks ago
parent f2fc3311ae
commit a42d1fe49e

@ -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

@ -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__

@ -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);

@ -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__

Loading…
Cancel
Save

Powered by TurnKey Linux.