From e682fe812e7e4096db370ea2dff51df33365c2cf Mon Sep 17 00:00:00 2001 From: Marco Bartolucci Date: Mon, 22 May 2017 11:40:12 +0200 Subject: [PATCH] Always call hackrf_set_hw_sync_mode in hackrf_transfer. Avoids the need to manually disable the hw synchronisation by specifyinh the option -H 0. Omitting -H 0 has the same effect. --- host/hackrf-tools/src/hackrf_transfer.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/host/hackrf-tools/src/hackrf_transfer.c b/host/hackrf-tools/src/hackrf_transfer.c index 0cf88b42..28eb5de9 100644 --- a/host/hackrf-tools/src/hackrf_transfer.c +++ b/host/hackrf-tools/src/hackrf_transfer.c @@ -311,7 +311,7 @@ bool signalsource = false; uint32_t amplitude = 0; bool hw_sync = false; -uint32_t hw_sync_enable; +uint32_t hw_sync_enable = 0; bool receive = false; bool receive_wav = false; @@ -963,13 +963,11 @@ int main(int argc, char** argv) { } } - if(hw_sync) { - fprintf(stderr, "call hackrf_set_hw_sync_mode(%d)\n", hw_sync_enable); - result = hackrf_set_hw_sync_mode(device, hw_sync_enable ? HW_SYNC_MODE_ON : HW_SYNC_MODE_OFF); - if( result != HACKRF_SUCCESS ) { - fprintf(stderr, "hackrf_set_hw_sync_mode() failed: %s (%d)\n", hackrf_error_name(result), result); - return EXIT_FAILURE; - } + fprintf(stderr, "call hackrf_set_hw_sync_mode(%d)\n", hw_sync_enable); + result = hackrf_set_hw_sync_mode(device, hw_sync_enable ? HW_SYNC_MODE_ON : HW_SYNC_MODE_OFF); + if( result != HACKRF_SUCCESS ) { + fprintf(stderr, "hackrf_set_hw_sync_mode() failed: %s (%d)\n", hackrf_error_name(result), result); + return EXIT_FAILURE; } if( transceiver_mode == TRANSCEIVER_MODE_RX ) {