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:
@ -311,7 +311,7 @@ bool signalsource = false;
|
|||||||
uint32_t amplitude = 0;
|
uint32_t amplitude = 0;
|
||||||
|
|
||||||
bool hw_sync = false;
|
bool hw_sync = false;
|
||||||
uint32_t hw_sync_enable;
|
uint32_t hw_sync_enable = 0;
|
||||||
|
|
||||||
bool receive = false;
|
bool receive = false;
|
||||||
bool receive_wav = false;
|
bool receive_wav = false;
|
||||||
@ -963,14 +963,12 @@ int main(int argc, char** argv) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(hw_sync) {
|
|
||||||
fprintf(stderr, "call hackrf_set_hw_sync_mode(%d)\n", hw_sync_enable);
|
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);
|
result = hackrf_set_hw_sync_mode(device, hw_sync_enable ? HW_SYNC_MODE_ON : HW_SYNC_MODE_OFF);
|
||||||
if( result != HACKRF_SUCCESS ) {
|
if( result != HACKRF_SUCCESS ) {
|
||||||
fprintf(stderr, "hackrf_set_hw_sync_mode() failed: %s (%d)\n", hackrf_error_name(result), result);
|
fprintf(stderr, "hackrf_set_hw_sync_mode() failed: %s (%d)\n", hackrf_error_name(result), result);
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if( transceiver_mode == TRANSCEIVER_MODE_RX ) {
|
if( transceiver_mode == TRANSCEIVER_MODE_RX ) {
|
||||||
result = hackrf_set_vga_gain(device, vga_gain);
|
result = hackrf_set_vga_gain(device, vga_gain);
|
||||||
|
Reference in New Issue
Block a user