aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2017-11-15 11:14:04 -0800
committerMartin Braun <martin.braun@ettus.com>2017-12-22 15:05:05 -0800
commite9a7db19ab1c2ad99c47092ffe186e46eccc0895 (patch)
tree5b4b1d13e9b76e9afdb59f4950ae63e2447aee35
parent08d8a34a2ae9b972a5465f910c50fec50d8cb0f8 (diff)
downloaduhd-e9a7db19ab1c2ad99c47092ffe186e46eccc0895.tar.gz
uhd-e9a7db19ab1c2ad99c47092ffe186e46eccc0895.tar.bz2
uhd-e9a7db19ab1c2ad99c47092ffe186e46eccc0895.zip
mpm: Fix minor logging issues with LMK04828 code
Log prefixes weren't properly being set.
-rw-r--r--mpm/python/usrp_mpm/chips/lmk04828.py5
-rw-r--r--mpm/python/usrp_mpm/dboard_manager/lmk_mg.py5
-rw-r--r--mpm/python/usrp_mpm/dboard_manager/magnesium.py2
3 files changed, 5 insertions, 7 deletions
diff --git a/mpm/python/usrp_mpm/chips/lmk04828.py b/mpm/python/usrp_mpm/chips/lmk04828.py
index 4d2839bf9..121d855ca 100644
--- a/mpm/python/usrp_mpm/chips/lmk04828.py
+++ b/mpm/python/usrp_mpm/chips/lmk04828.py
@@ -27,9 +27,8 @@ class LMK04828(object):
"""
LMK_CHIP_ID = 6
- def __init__(self, regs_iface, postfix=None):
- postfix = postfix or ""
- self.log = get_logger("LMK04828-{}".format(postfix))
+ def __init__(self, regs_iface, parent_log=None):
+ self.log = parent_log.getChild("LMK04828") or get_logger("LMK04828")
self.regs_iface = regs_iface
assert hasattr(self.regs_iface, 'peek8')
assert hasattr(self.regs_iface, 'poke8')
diff --git a/mpm/python/usrp_mpm/dboard_manager/lmk_mg.py b/mpm/python/usrp_mpm/dboard_manager/lmk_mg.py
index 4890645aa..e6a1821af 100644
--- a/mpm/python/usrp_mpm/dboard_manager/lmk_mg.py
+++ b/mpm/python/usrp_mpm/dboard_manager/lmk_mg.py
@@ -25,11 +25,10 @@ from ..mpmlog import get_logger
from ..chips import LMK04828
class LMK04828Mg(LMK04828):
- def __init__(self, regs_iface, spi_lock, ref_clock_freq, slot=None):
- LMK04828.__init__(self, regs_iface, slot)
+ def __init__(self, regs_iface, spi_lock, ref_clock_freq, log=None):
+ LMK04828.__init__(self, regs_iface, log)
self.log.trace("Using reference clock frequency {} MHz".format(ref_clock_freq/1e6))
self.spi_lock = spi_lock
- self.log = get_logger("LMK04828")
assert hasattr(self.spi_lock, 'lock')
assert hasattr(self.spi_lock, 'unlock')
self.ref_clock_freq = ref_clock_freq
diff --git a/mpm/python/usrp_mpm/dboard_manager/magnesium.py b/mpm/python/usrp_mpm/dboard_manager/magnesium.py
index 02803b61c..032502012 100644
--- a/mpm/python/usrp_mpm/dboard_manager/magnesium.py
+++ b/mpm/python/usrp_mpm/dboard_manager/magnesium.py
@@ -468,7 +468,7 @@ class Magnesium(DboardManagerBase):
))
pdac_spi.poke16(0x0, init_phase_dac_word)
self.spi_lock = self._device.get_spi_lock()
- return LMK04828Mg(lmk_spi, self.spi_lock, ref_clk_freq, slot_idx)
+ return LMK04828Mg(lmk_spi, self.spi_lock, ref_clk_freq, self.log)
def _sync_db_clock(synchronizer):
" Synchronizes the DB clock to the common reference "
synchronizer.run_sync(measurement_only=False)