diff options
author | Thomas Tsou <tom@tsou.cc> | 2013-10-16 00:31:18 -0400 |
---|---|---|
committer | Thomas Tsou <tom@tsou.cc> | 2013-10-18 13:10:18 -0400 |
commit | 010fff783bf658e79b0b32ad64a44af4e3f22b1e (patch) | |
tree | c20d18d41b36261f9e525bdfb5bea7e1a24c66a5 /Transceiver52M/UHDDevice.cpp | |
parent | 61b4a6ad9f959421b2bf61e6e55bb0713f0db822 (diff) |
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>
Diffstat (limited to 'Transceiver52M/UHDDevice.cpp')
-rw-r--r-- | Transceiver52M/UHDDevice.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
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 @@ public: 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 @@ bool uhd_device::parse_dev_type() 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 @@ int uhd_device::open(const std::string &args) 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); |