mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2024-12-25 02:18:30 +01:00
fixed limesdr antenna not set on startup and worked around limesuite bug
This commit is contained in:
parent
25f09a355e
commit
277d399e48
@ -323,12 +323,20 @@ private:
|
|||||||
// Open device
|
// Open device
|
||||||
_this->openDev = NULL;
|
_this->openDev = NULL;
|
||||||
LMS_Open(&_this->openDev, _this->devList[_this->devId], NULL);
|
LMS_Open(&_this->openDev, _this->devList[_this->devId], NULL);
|
||||||
LMS_Init(_this->openDev);
|
int err = LMS_Init(_this->openDev);
|
||||||
|
|
||||||
|
// On open fail, retry (work around for LimeSuite bug)
|
||||||
|
if (err) {
|
||||||
|
LMS_Close(_this->openDev);
|
||||||
|
LMS_Open(&_this->openDev, _this->devList[_this->devId], NULL);
|
||||||
|
LMS_Init(_this->openDev);
|
||||||
|
}
|
||||||
|
|
||||||
spdlog::warn("Channel count: {0}", LMS_GetNumChannels(_this->openDev, false));
|
spdlog::warn("Channel count: {0}", LMS_GetNumChannels(_this->openDev, false));
|
||||||
|
|
||||||
// Set options
|
// Set options
|
||||||
LMS_EnableChannel(_this->openDev, false, _this->chanId, true);
|
LMS_EnableChannel(_this->openDev, false, _this->chanId, true);
|
||||||
|
LMS_SetAntenna(_this->openDev, false, _this->chanId, _this->antennaId);
|
||||||
LMS_SetSampleRate(_this->openDev, _this->sampleRate, 0);
|
LMS_SetSampleRate(_this->openDev, _this->sampleRate, 0);
|
||||||
LMS_SetLOFrequency(_this->openDev, false, _this->chanId, _this->freq);
|
LMS_SetLOFrequency(_this->openDev, false, _this->chanId, _this->freq);
|
||||||
LMS_SetGaindB(_this->openDev, false, _this->chanId, _this->gain);
|
LMS_SetGaindB(_this->openDev, false, _this->chanId, _this->gain);
|
||||||
@ -364,6 +372,7 @@ private:
|
|||||||
|
|
||||||
LMS_StopStream(&_this->devStream);
|
LMS_StopStream(&_this->devStream);
|
||||||
LMS_DestroyStream(_this->openDev, &_this->devStream);
|
LMS_DestroyStream(_this->openDev, &_this->devStream);
|
||||||
|
LMS_EnableChannel(_this->openDev, false, _this->chanId, false);
|
||||||
|
|
||||||
LMS_Close(_this->openDev);
|
LMS_Close(_this->openDev);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user