diff options
author | Scott Torborg <storborg@gmail.com> | 2018-03-04 18:24:13 -0800 |
---|---|---|
committer | Brent Stapleton <bstapleton@g.hmc.edu> | 2018-11-16 10:39:53 -0800 |
commit | 2df06060b57f33e095bfd08ce8143a7053c6fb6e (patch) | |
tree | d1b0f0485a8a3e3f188218ccf2196f72e8735926 /host/lib/usrp/x300/x300_device_args.hpp | |
parent | 1f0c8bd2c76a3d9149fd72a8b1a9a8356362018e (diff) | |
download | uhd-2df06060b57f33e095bfd08ce8143a7053c6fb6e.tar.gz uhd-2df06060b57f33e095bfd08ce8143a7053c6fb6e.tar.bz2 uhd-2df06060b57f33e095bfd08ce8143a7053c6fb6e.zip |
x300: New mode to configure master clock rate
Add a new clocking mode to automatically configure arbitrary master
clock rates.
Co-authored-by: Brent Stapleton <brent.stapleton@ettus.com>
Co-authored-by: Martin Braun <martin.braun@ettus.com>
Diffstat (limited to 'host/lib/usrp/x300/x300_device_args.hpp')
-rw-r--r-- | host/lib/usrp/x300/x300_device_args.hpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/host/lib/usrp/x300/x300_device_args.hpp b/host/lib/usrp/x300/x300_device_args.hpp index 56b3c1078..db1a01212 100644 --- a/host/lib/usrp/x300/x300_device_args.hpp +++ b/host/lib/usrp/x300/x300_device_args.hpp @@ -8,6 +8,7 @@ #define INCLUDED_X300_DEV_ARGS_HPP #include "x300_impl.hpp" +#include "x300_defaults.hpp" #include <uhdlib/usrp/constrained_device_args.hpp> namespace uhd { namespace usrp { namespace x300 { @@ -117,10 +118,9 @@ private: // Some daughterboards may require other rates, but this default // works best for all newer daughterboards (i.e. CBX, WBX, SBX, // UBX, and TwinRX). - if (_master_clock_rate.get() == 200e6) { - _dboard_clock_rate.set(50e6); - } else if (_master_clock_rate.get() == 184.32e6) { - _dboard_clock_rate.set(46.08e6); + if (_master_clock_rate.get() >= MIN_TICK_RATE && + _master_clock_rate.get() <= MAX_TICK_RATE) { + _dboard_clock_rate.set(_master_clock_rate.get() / 4); } else { throw uhd::value_error( "Can't infer daughterboard clock rate. Specify " @@ -157,7 +157,7 @@ private: } //Sanity check params - _enforce_discrete(_master_clock_rate, TICK_RATE_OPTIONS); + _enforce_range(_master_clock_rate, MIN_TICK_RATE, MAX_TICK_RATE); _enforce_discrete(_system_ref_rate, EXTERNAL_FREQ_OPTIONS); _enforce_discrete(_clock_source, CLOCK_SOURCE_OPTIONS); _enforce_discrete(_time_source, TIME_SOURCE_OPTIONS); |