Transceiver52M: Move reference select from compile time to database
Enabling the external reference on UHD devices through the configure
time switch is awkward. Use a database variable "TRX.Reference" with
'0' or '1' value for internal and external references respectively.
Use internal reference is no entry is defined.
Signed-off-by: Thomas Tsou <tom@tsou.cc>
diff --git a/Transceiver52M/UHDDevice.cpp b/Transceiver52M/UHDDevice.cpp
index 03ff0ca..a392222 100644
--- a/Transceiver52M/UHDDevice.cpp
+++ b/Transceiver52M/UHDDevice.cpp
@@ -214,7 +214,7 @@
uhd_device(int sps, bool skip_rx);
~uhd_device();
- int open(const std::string &args);
+ int open(const std::string &args, bool extref);
bool start();
bool stop();
void restart(uhd::time_spec_t ts);
@@ -519,7 +519,7 @@
return true;
}
-int uhd_device::open(const std::string &args)
+int uhd_device::open(const std::string &args, bool extref)
{
// Find UHD devices
uhd::device_addr_t addr(args);
@@ -542,9 +542,9 @@
if (!parse_dev_type())
return -1;
-#ifdef EXTREF
- set_ref_clk(true);
-#endif
+ if (extref)
+ set_ref_clk(true);
+
// Create TX and RX streamers
uhd::stream_args_t stream_args("sc16");
tx_stream = usrp_dev->get_tx_stream(stream_args);