aboutsummaryrefslogtreecommitdiffstats
path: root/Transceiver52M
diff options
context:
space:
mode:
authorkurtis.heimerl <kurtis.heimerl@19bc5d8c-e614-43d4-8b26-e1612bc8e597>2011-11-28 06:25:58 +0000
committerkurtis.heimerl <kurtis.heimerl@19bc5d8c-e614-43d4-8b26-e1612bc8e597>2011-11-28 06:25:58 +0000
commitac0ee1289a959fd0308be006b74799a617106378 (patch)
tree9e0eb578bf8361c915020b50d56908f4faee2e4a /Transceiver52M
parent4ba47189f80ee5f5614b63a6d5e5cd6d171bb630 (diff)
transceiver, uhd: runtime check for setting master clock rate
Before setting the master clock rate, make sure that the device is capable of being set. For now, assume that devices that operate with default clock rates above 64 MHz, specifically USRP2/N200/N210, cannot be set at 52 MHz. Inform the user that these devices can be used with the compile time option of host based resampling. Signed-off-by: Thomas Tsou <ttsou@vt.edu> git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2697 19bc5d8c-e614-43d4-8b26-e1612bc8e597
Diffstat (limited to 'Transceiver52M')
-rw-r--r--Transceiver52M/UHDDevice.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/Transceiver52M/UHDDevice.cpp b/Transceiver52M/UHDDevice.cpp
index 4eba136..32f6d0f 100644
--- a/Transceiver52M/UHDDevice.cpp
+++ b/Transceiver52M/UHDDevice.cpp
@@ -31,6 +31,9 @@
#include "config.h"
#endif
+#define U1_DEFAULT_CLK_RT 64e6
+#define U2_DEFAULT_CLK_RT 100e6
+
/*
master_clk_rt - Master clock frequency - ignored if host resampling is
enabled
@@ -325,6 +328,14 @@ double uhd_device::set_rates(double rate)
double actual_rt, actual_clk_rt;
#ifndef RESAMPLE
+ // Make sure we can set the master clock rate on this device
+ actual_clk_rt = usrp_dev->get_master_clock_rate();
+ if (actual_clk_rt > U1_DEFAULT_CLK_RT) {
+ LOG(ALERT) << "Cannot set clock rate on this device";
+ LOG(ALERT) << "Please compile with host resampling support";
+ return -1.0;
+ }
+
// Set master clock rate
usrp_dev->set_master_clock_rate(master_clk_rt);
actual_clk_rt = usrp_dev->get_master_clock_rate();