1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-01 13:47:01 -04:00

Import USRP support.

Add LO offset support.
Only set tx/rx_bandwidth after getting tx stream, to reduce TX LO leakage for <10MHz bandwidths.
Check for reference and LO lock before getting streams.
This commit is contained in:
Jon Beniston
2020-10-25 11:57:48 +00:00
parent 209be94947
commit d8ae6fc765
17 changed files with 299 additions and 70 deletions
+28
View File
@@ -69,3 +69,31 @@ void DeviceUSRP::enumOriginDevices(const QString& hardwareId, PluginInterface::O
qDebug() << "DeviceUSRP::enumOriginDevices: exception: " << e.what();
}
}
void DeviceUSRP::waitForLock(uhd::usrp::multi_usrp::sptr usrp, const QString& clockSource, int channel)
{
int tries;
const int maxTries = 100;
// Wait for Ref lock
std::vector<std::string> sensor_names;
sensor_names = usrp->get_tx_sensor_names(channel);
if (clockSource == "external")
{
if (std::find(sensor_names.begin(), sensor_names.end(), "ref_locked") != sensor_names.end())
{
for (tries = 0; !usrp->get_mboard_sensor("ref_locked", 0).to_bool() && (tries < maxTries); tries++)
std::this_thread::sleep_for(std::chrono::milliseconds(10));
if (tries == maxTries)
qCritical("USRPInput::acquireChannel: Failed to lock ref");
}
}
// Wait for LO lock
if (std::find(sensor_names.begin(), sensor_names.end(), "lo_locked") != sensor_names.end())
{
for (tries = 0; !usrp->get_tx_sensor("lo_locked", channel).to_bool() && (tries < maxTries); tries++)
std::this_thread::sleep_for(std::chrono::milliseconds(10));
if (tries == maxTries)
qCritical("USRPInput::acquireChannel: Failed to lock LO");
}
}