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.
This commit is contained in:
Marco Bartolucci
2017-05-22 11:40:12 +02:00
parent 8d0187770a
commit e682fe812e

View File

@ -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 ) {