Compare commits

..

No commits in common. "fe4a7b32a7656de8c8f4c4efa926cf6f21a9c1d9" and "0e1ab29b5d79a056edb6d322c9f778d1272aa797" have entirely different histories.

View File

@ -10,7 +10,6 @@
#include <libbladeRF.h>
#include <gui/smgui.h>
#include <algorithm>
#include <utils/optionlist.h>
#define CONCAT(a, b) ((std::string(a) + b).c_str())
@ -38,10 +37,6 @@ public:
BladeRFSourceModule(std::string name) {
this->name = name;
// Define clocks
clocks.define("onboard", "On-Board", CLOCK_SELECT_ONBOARD);
clocks.define("external", "External", CLOCK_SELECT_EXTERNAL);
sampleRate = 1000000.0;
handler.ctx = this;
@ -272,15 +267,6 @@ public:
}
config.release(true);
// Load clock source
clkId = clocks.keyId("onboard");
if (config.conf["devices"][selectedSerial].contains("clock")) {
std::string clkStr = config.conf["devices"][selectedSerial]["clock"];
if (clocks.keyExists(clkStr)) {
clkId = clocks.keyId(clkStr);
}
}
// Load gain mode
if (config.conf["devices"][selectedSerial].contains("gainMode")) {
std::string gm = config.conf["devices"][selectedSerial]["gainMode"];
@ -378,7 +364,6 @@ private:
if (_this->bufferSize < 1024) { _this->bufferSize = 1024; }
// Setup device parameters
_this->setClockSource(_this->clocks[_this->clkId]);
bladerf_set_sample_rate(_this->openDev, BLADERF_CHANNEL_RX(_this->chanId), _this->sampleRate, NULL);
bladerf_set_frequency(_this->openDev, BLADERF_CHANNEL_RX(_this->chanId), _this->freq);
bladerf_set_bandwidth(_this->openDev, BLADERF_CHANNEL_RX(_this->chanId), (_this->bwId == _this->bandwidths.size()) ? std::clamp<uint64_t>(_this->sampleRate, _this->bwRange->min, _this->bwRange->max) : _this->bandwidths[_this->bwId], NULL);
@ -501,19 +486,6 @@ private:
}
}
SmGui::LeftLabel("Clock Source");
SmGui::FillWidth();
if (SmGui::Combo(CONCAT("##_balderf_clk_sel_", _this->name), &_this->clkId, _this->clocks.txt)) {
if (_this->running) {
_this->setClockSource(_this->clocks[_this->clkId]);
}
if (_this->selectedSerial != "") {
config.acquire();
config.conf["devices"][_this->selectedSerial]["clock"] = _this->clocks.key(_this->clkId);
config.release(true);
}
}
// General config BS
SmGui::LeftLabel("Gain control mode");
SmGui::FillWidth();
@ -565,15 +537,6 @@ private:
}
}
void setClockSource(bladerf_clock_select clk) {
if (selectedBladeType == BLADERF_TYPE_V1) {
bladerf_set_smb_mode(openDev, (clk == CLOCK_SELECT_EXTERNAL) ? BLADERF_SMB_MODE_INPUT : BLADERF_SMB_MODE_DISABLED);
}
else {
bladerf_set_clock_select(openDev, clk);
}
}
void worker() {
int16_t* buffer = new int16_t[bufferSize * 2];
bladerf_metadata meta;
@ -602,7 +565,6 @@ private:
int devId = 0;
int srId = 0;
int bwId = 0;
int clkId = 0;
int chanId = 0;
int gainMode = 0;
bool streamingEnabled = false;
@ -618,8 +580,8 @@ private:
std::string sampleRatesTxt;
std::vector<uint64_t> bandwidths;
std::string bandwidthsTxt;
std::string channelNamesTxt;
OptionList<std::string, bladerf_clock_select> clocks;
int bufferSize;
struct bladerf_stream* rxStream;