hackrf_sweep: exit early from rx_callback if do_exit set

Sometimes, if a small frequency interval is scanned, the callback is
triggered even though we already have the number of sweeps we want, and
sweep_count gets increased, showing the wrong "Total sweeps".
This commit is contained in:
Yan
2021-03-20 10:07:51 +01:00
parent 4c46fc74b3
commit ab4498f8ac

View File

@ -220,6 +220,9 @@ int rx_callback(hackrf_transfer* transfer) {
return -1;
}
if(do_exit) {
return 0;
}
gettimeofday(&usb_transfer_time, NULL);
byte_count += transfer->valid_length;
buf = (int8_t*) transfer->buffer;