aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/dboard
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-10-22 16:59:12 -0700
committerJosh Blum <josh@joshknows.com>2010-10-22 16:59:12 -0700
commit3974e544393bd5a720838cbf4790c532bca2aae4 (patch)
tree7d992deb3836b20ad772fee12c535761b95b812d /host/lib/usrp/dboard
parente2f76bddae7845024056b479658651c6da2b0f4d (diff)
downloaduhd-3974e544393bd5a720838cbf4790c532bca2aae4.tar.gz
uhd-3974e544393bd5a720838cbf4790c532bca2aae4.tar.bz2
uhd-3974e544393bd5a720838cbf4790c532bca2aae4.zip
dbsrx: reject asymmetric clocks (odd divisors)
Diffstat (limited to 'host/lib/usrp/dboard')
-rw-r--r--host/lib/usrp/dboard/db_dbsrx.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/host/lib/usrp/dboard/db_dbsrx.cpp b/host/lib/usrp/dboard/db_dbsrx.cpp
index 0b8b4db83..aecd7249d 100644
--- a/host/lib/usrp/dboard/db_dbsrx.cpp
+++ b/host/lib/usrp/dboard/db_dbsrx.cpp
@@ -236,8 +236,10 @@ void dbsrx::set_lo_freq(double target_freq){
bool update_filter_settings = false;
//choose refclock
std::vector<double> clock_rates = this->get_iface()->get_clock_rates(dboard_iface::UNIT_RX);
+ const double max_clock_rate = std::sorted(clock_rates).back();
BOOST_FOREACH(ref_clock, std::reversed(std::sorted(clock_rates))){
if (ref_clock > 27.0e6) continue;
+ if (size_t(max_clock_rate/ref_clock)%2 == 1) continue; //reject asymmetric clocks (odd divisors)
//choose m_divider such that filter tuning constraint is met
m = 31;