hackrf_sweep: suppress processing and output until the first expected frequency is seen

This commit is contained in:
Michael Ossmann
2017-02-08 00:37:42 -07:00
parent 5ab315a73a
commit 5e6e70659b

View File

@ -173,6 +173,7 @@ bool antenna = false;
uint32_t antenna_enable; uint32_t antenna_enable;
bool binary_output = false; bool binary_output = false;
volatile bool sweep_started = false;
int fftSize = 20; int fftSize = 20;
uint32_t fft_bin_width; uint32_t fft_bin_width;
@ -216,6 +217,14 @@ int rx_callback(hackrf_transfer* transfer) {
buf += SAMPLES_PER_BLOCK; buf += SAMPLES_PER_BLOCK;
break; break;
} }
if(!sweep_started) {
if (frequency == (uint64_t)(FREQ_ONE_MHZ*frequencies[0])) {
sweep_started = true;
} else {
buf += SAMPLES_PER_BLOCK;
continue;
}
}
if((FREQ_MAX_MHZ * FREQ_ONE_MHZ) < frequency) { if((FREQ_MAX_MHZ * FREQ_ONE_MHZ) < frequency) {
buf += SAMPLES_PER_BLOCK; buf += SAMPLES_PER_BLOCK;
break; break;