From 5e6e70659bf520af56d09053c88efecfc07ab072 Mon Sep 17 00:00:00 2001 From: Michael Ossmann Date: Wed, 8 Feb 2017 00:37:42 -0700 Subject: [PATCH] hackrf_sweep: suppress processing and output until the first expected frequency is seen --- host/hackrf-tools/src/hackrf_sweep.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/host/hackrf-tools/src/hackrf_sweep.c b/host/hackrf-tools/src/hackrf_sweep.c index 40bdb6eb..de08f7e2 100644 --- a/host/hackrf-tools/src/hackrf_sweep.c +++ b/host/hackrf-tools/src/hackrf_sweep.c @@ -173,6 +173,7 @@ bool antenna = false; uint32_t antenna_enable; bool binary_output = false; +volatile bool sweep_started = false; int fftSize = 20; uint32_t fft_bin_width; @@ -216,6 +217,14 @@ int rx_callback(hackrf_transfer* transfer) { buf += SAMPLES_PER_BLOCK; 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) { buf += SAMPLES_PER_BLOCK; break;