aboutsummaryrefslogtreecommitdiffstats
path: root/mpm/python/usrp_mpm
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2018-01-22 13:54:19 -0800
committerMartin Braun <martin.braun@ettus.com>2018-01-22 14:02:24 -0800
commitdee1d75339830b5d54971917ddc9dae2cd3dd6c8 (patch)
tree6a401110e4dd758587a14362b70ed2f03253b8c8 /mpm/python/usrp_mpm
parentde51d0ec9cc05b56be07c2e46e82a6adfb998b89 (diff)
downloaduhd-dee1d75339830b5d54971917ddc9dae2cd3dd6c8.tar.gz
uhd-dee1d75339830b5d54971917ddc9dae2cd3dd6c8.tar.bz2
uhd-dee1d75339830b5d54971917ddc9dae2cd3dd6c8.zip
mpm: n310: Fix setting time source depending on clock source
- When clock source is set, but time source is not, still set time source to guarantee correct ref clock freq - Enable unconditional setting of time source Reviewed-by: Daniel Jepson <daniel.jepson@ettus.com>
Diffstat (limited to 'mpm/python/usrp_mpm')
-rw-r--r--mpm/python/usrp_mpm/periph_manager/n310.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/mpm/python/usrp_mpm/periph_manager/n310.py b/mpm/python/usrp_mpm/periph_manager/n310.py
index c56e27b95..97cb0d770 100644
--- a/mpm/python/usrp_mpm/periph_manager/n310.py
+++ b/mpm/python/usrp_mpm/periph_manager/n310.py
@@ -588,10 +588,10 @@ class n310(PeriphManagerBase):
self.log.warning(
"Cannot run init(), device was never fully initialized!")
return False
- if args.get("clock_source", "") != "":
+ if "clock_source" in args:
self.set_clock_source(args.get("clock_source"))
- if args.get("time_source", "") != "":
- self.set_time_source(args.get("time_source"))
+ if "clock_source" in args or "time_source" in args:
+ self.set_time_source(args.get("time_source", self.get_time_source()))
result = super(n310, self).init(args)
for xport_mgr in itervalues(self._xport_mgrs):
xport_mgr.init(args)
@@ -782,12 +782,9 @@ class n310(PeriphManagerBase):
def set_time_source(self, time_source):
" Set a time source "
assert time_source in self.get_time_sources()
- if time_source == self.get_time_source():
- self.log.trace("Nothing to do -- time source already set.")
- return
self._time_source = time_source
self.mboard_regs_control.set_time_source(
- time_source, self.get_ref_clock_freq())
+ time_source, self.get_ref_clock_freq())
###########################################################################
# Hardware periphal controls