Skip to content

Commit

Permalink
fix some settings not applied on start for RSP1B and RSPdxR2
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexandreRouma committed Dec 19, 2024
1 parent 45e4286 commit 46bcba7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions source_modules/sdrplay_source/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ const char* ifModeTxt =

const char* rspduo_antennaPortsTxt = "Tuner 1 (50Ohm)\0Tuner 1 (Hi-Z)\0Tuner 2 (50Ohm)\0";

#define MAX_DEV_COUNT 16

class SDRPlaySourceModule : public ModuleManager::Instance {
public:
SDRPlaySourceModule(std::string name) {
Expand Down Expand Up @@ -146,9 +148,9 @@ class SDRPlaySourceModule : public ModuleManager::Instance {
devNameList.clear();
devListTxt = "";

sdrplay_api_DeviceT devArr[128];
sdrplay_api_DeviceT devArr[MAX_DEV_COUNT];
unsigned int numDev = 0;
sdrplay_api_GetDevices(devArr, &numDev, 128);
sdrplay_api_GetDevices(devArr, &numDev, MAX_DEV_COUNT);

for (unsigned int i = 0; i < numDev; i++) {
devList.push_back(devArr[i]);
Expand Down Expand Up @@ -532,7 +534,7 @@ class SDRPlaySourceModule : public ModuleManager::Instance {
_this->bufferSize = (float)_this->sampleRate / 200.0f;

// RSP1A Options
if (_this->openDev.hwVer == SDRPLAY_RSP1A_ID) {
if (_this->openDev.hwVer == SDRPLAY_RSP1A_ID || _this->openDev.hwVer == SDRPLAY_RSP1B_ID) {
_this->openDevParams->devParams->rsp1aParams.rfNotchEnable = _this->rsp1a_fmmwNotch;
_this->openDevParams->devParams->rsp1aParams.rfDabNotchEnable = _this->rsp1a_dabNotch;
_this->channelParams->rsp1aTunerParams.biasTEnable = _this->rsp1a_biasT;
Expand Down Expand Up @@ -562,7 +564,7 @@ class SDRPlaySourceModule : public ModuleManager::Instance {
sdrplay_api_Update(_this->openDev.dev, _this->openDev.tuner, sdrplay_api_Update_RspDuo_RfDabNotchControl, sdrplay_api_Update_Ext1_None);
sdrplay_api_Update(_this->openDev.dev, _this->openDev.tuner, sdrplay_api_Update_RspDuo_Tuner1AmNotchControl, sdrplay_api_Update_Ext1_None);
}
else if (_this->openDev.hwVer == SDRPLAY_RSPdx_ID) {
else if (_this->openDev.hwVer == SDRPLAY_RSPdx_ID || _this->openDev.hwVer == SDRPLAY_RSPdxR2_ID) {
_this->openDevParams->devParams->rspDxParams.rfNotchEnable = _this->rspdx_fmmwNotch;
_this->openDevParams->devParams->rspDxParams.rfDabNotchEnable = _this->rspdx_dabNotch;
_this->openDevParams->devParams->rspDxParams.biasTEnable = _this->rspdx_biasT;
Expand Down

0 comments on commit 46bcba7

Please # to comment.