From 4c46fc74b39e437ad48612e15b8a2974f0c7520b Mon Sep 17 00:00:00 2001 From: Yan Date: Fri, 19 Mar 2021 16:31:37 +0100 Subject: [PATCH] hackrf_sweep: speed up ending by removing unnecessary code hackrf_stop_rx() is handled in hackrf_close(), so there seems to be no need to call it separately. Furthermore, if hackrf_stop() is called separately, it causes hackrf_close() to take more than half a second longer. --- host/hackrf-tools/src/hackrf_sweep.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/host/hackrf-tools/src/hackrf_sweep.c b/host/hackrf-tools/src/hackrf_sweep.c index 38a4c297..e81c809d 100644 --- a/host/hackrf-tools/src/hackrf_sweep.c +++ b/host/hackrf-tools/src/hackrf_sweep.c @@ -742,14 +742,6 @@ int main(int argc, char** argv) { sweep_count, time_diff, sweep_rate); if(device != NULL) { - result = hackrf_stop_rx(device); - if(result != HACKRF_SUCCESS) { - fprintf(stderr, "hackrf_stop_rx() failed: %s (%d)\n", - hackrf_error_name(result), result); - } else { - fprintf(stderr, "hackrf_stop_rx() done\n"); - } - result = hackrf_close(device); if(result != HACKRF_SUCCESS) { fprintf(stderr, "hackrf_close() failed: %s (%d)\n",