hackrf_stop_rx: First set mode, then kill transfer thread
Killing the transfer thread first means that the host stops polling the device for reads, causing the device to hang while scheduling the dTD
This commit is contained in:
@ -1141,14 +1141,13 @@ int ADDCALL hackrf_start_rx(hackrf_device* device, hackrf_sample_block_cb_fn cal
|
|||||||
|
|
||||||
int ADDCALL hackrf_stop_rx(hackrf_device* device)
|
int ADDCALL hackrf_stop_rx(hackrf_device* device)
|
||||||
{
|
{
|
||||||
int result1, result2;
|
int result;
|
||||||
result1 = kill_transfer_thread(device);
|
result = hackrf_set_transceiver_mode(device, HACKRF_TRANSCEIVER_MODE_OFF);
|
||||||
result2 = hackrf_set_transceiver_mode(device, HACKRF_TRANSCEIVER_MODE_OFF);
|
if (result != HACKRF_SUCCESS)
|
||||||
if (result2 != HACKRF_SUCCESS)
|
|
||||||
{
|
{
|
||||||
return result2;
|
return result2;
|
||||||
}
|
}
|
||||||
return result1;
|
return kill_transfer_thread(device);
|
||||||
}
|
}
|
||||||
|
|
||||||
int ADDCALL hackrf_start_tx(hackrf_device* device, hackrf_sample_block_cb_fn callback, void* tx_ctx)
|
int ADDCALL hackrf_start_tx(hackrf_device* device, hackrf_sample_block_cb_fn callback, void* tx_ctx)
|
||||||
|
Reference in New Issue
Block a user