1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-23 01:55:48 -05:00

LimeSDR: use CMIX_BYP_TXTSP to control NCO on/off

This commit is contained in:
f4exb 2017-09-30 18:29:53 +02:00
parent 229027c345
commit 7c558b15f5

View File

@ -56,20 +56,41 @@ bool DeviceLimeSDR::setNCOFrequency(lms_device_t *device, bool dir_tx, std::size
return false;
}
return true;
}
else
if (dir_tx)
{
if (LMS_SetNCOIndex(device, dir_tx, chan, LMS_NCO_VAL_COUNT, true) < 0)
{
fprintf(stderr, "DeviceLimeSDR::setNCOFrequency: cannot disable NCO\n");
if (LMS_WriteParam(device,LMS7param(CMIX_BYP_TXTSP),0) < 0) {
fprintf(stderr, "DeviceLimeSDR::setNCOFrequency: cannot enable Tx NCO\n");
return false;
}
}
else
{
fprintf(stderr, "DeviceLimeSDR::setNCOFrequency: NCO disabled\n");
if (LMS_WriteParam(device,LMS7param(CMIX_BYP_RXTSP),0) < 0) {
fprintf(stderr, "DeviceLimeSDR::setNCOFrequency: cannot enable Rx NCO\n");
return false;
}
}
return true;
}
else
{
if (dir_tx)
{
if (LMS_WriteParam(device,LMS7param(CMIX_BYP_TXTSP),1) < 0) {
fprintf(stderr, "DeviceLimeSDR::setNCOFrequency: cannot disable Tx NCO\n");
return false;
}
}
else
{
if (LMS_WriteParam(device,LMS7param(CMIX_BYP_RXTSP),1) < 0) {
fprintf(stderr, "DeviceLimeSDR::setNCOFrequency: cannot disable Rx NCO\n");
return false;
}
}
return true;
}
}