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.
This commit is contained in:
Yan
2021-03-19 16:31:37 +01:00
parent 2ef7995763
commit 4c46fc74b3

View File

@ -742,14 +742,6 @@ int main(int argc, char** argv) {
sweep_count, time_diff, sweep_rate); sweep_count, time_diff, sweep_rate);
if(device != NULL) { 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); result = hackrf_close(device);
if(result != HACKRF_SUCCESS) { if(result != HACKRF_SUCCESS) {
fprintf(stderr, "hackrf_close() failed: %s (%d)\n", fprintf(stderr, "hackrf_close() failed: %s (%d)\n",