Fixed more LimeSDR bugs

This commit is contained in:
Ryzerth 2021-07-01 22:22:36 +02:00
parent b87ec8f2cc
commit 7d720e4d6f

View File

@ -142,6 +142,8 @@ public:
// List antennas // List antennas
lms_name_t antennaNames[16]; lms_name_t antennaNames[16];
antennaCount = LMS_GetAntennaList(dev, false, chanId, antennaNames); antennaCount = LMS_GetAntennaList(dev, false, chanId, antennaNames);
antennaNameList.clear();
antennaListTxt = "";
for (int i = 0; i < antennaCount; i++) { for (int i = 0; i < antennaCount; i++) {
antennaNameList.push_back(antennaNames[i]); antennaNameList.push_back(antennaNames[i]);
antennaListTxt += antennaNames[i]; antennaListTxt += antennaNames[i];
@ -151,6 +153,8 @@ public:
// List supported sample rates // List supported sample rates
lms_range_t srRange; lms_range_t srRange;
LMS_GetSampleRateRange(dev, false, &srRange); LMS_GetSampleRateRange(dev, false, &srRange);
sampleRates.clear();
sampleRatesTxt = "";
sampleRates.push_back(srRange.min); sampleRates.push_back(srRange.min);
sampleRatesTxt += getBandwdithScaled(srRange.min); sampleRatesTxt += getBandwdithScaled(srRange.min);
sampleRatesTxt += '\0'; sampleRatesTxt += '\0';
@ -166,7 +170,8 @@ public:
// List supported bandwidths // List supported bandwidths
lms_range_t bwRange; lms_range_t bwRange;
LMS_GetLPFBWRange(dev, false, &bwRange); LMS_GetLPFBWRange(dev, false, &bwRange);
spdlog::warn("bw step {0}", bwRange.step); bandwidths.clear();
bandwidthsTxt = "";
bandwidths.push_back(bwRange.min); bandwidths.push_back(bwRange.min);
bandwidthsTxt += getBandwdithScaled(bwRange.min); bandwidthsTxt += getBandwdithScaled(bwRange.min);
bandwidthsTxt += '\0'; bandwidthsTxt += '\0';
@ -259,7 +264,7 @@ public:
// Load gain // Load gain
if (config.conf["devices"][selectedDevName].contains("gain")) { if (config.conf["devices"][selectedDevName].contains("gain")) {
gain = config.conf["devices"][selectedDevName]["gain"]; gain = config.conf["devices"][selectedDevName]["gain"];
gain = std::clamp<int>(bwId, 0, 73); gain = std::clamp<int>(gain, 0, 73);
} }
else { else {
gain = 0; gain = 0;