hackrf_sweep: don't skip more input than necessary when waiting for valid data

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

View File

@ -215,7 +215,7 @@ int rx_callback(hackrf_transfer* transfer) {
| ((uint64_t)(ubuf[3]) << 8) | ubuf[2]; | ((uint64_t)(ubuf[3]) << 8) | ubuf[2];
} else { } else {
buf += SAMPLES_PER_BLOCK; buf += SAMPLES_PER_BLOCK;
break; continue;
} }
if(!sweep_started) { if(!sweep_started) {
if (frequency == (uint64_t)(FREQ_ONE_MHZ*frequencies[0])) { if (frequency == (uint64_t)(FREQ_ONE_MHZ*frequencies[0])) {
@ -227,7 +227,7 @@ int rx_callback(hackrf_transfer* transfer) {
} }
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; continue;
} }
/* copy to fftwIn as floats */ /* copy to fftwIn as floats */
buf += SAMPLES_PER_BLOCK - (fftSize * 2); buf += SAMPLES_PER_BLOCK - (fftSize * 2);