diff options
author | Martin Braun <martin.braun@ettus.com> | 2018-01-16 12:10:37 -0800 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2018-01-16 12:10:37 -0800 |
commit | 2d424a54fcb2c183441dbb96c39c63b80524529c (patch) | |
tree | 7e4bf85370f2ad176f4c398c67f3a9e5d6d7bbd9 /mpm/python/usrp_mpm/periph_manager/n310.py | |
parent | 400713fba4ff6b51118c99fcf1dcdd32297a7f5e (diff) | |
download | uhd-2d424a54fcb2c183441dbb96c39c63b80524529c.tar.gz uhd-2d424a54fcb2c183441dbb96c39c63b80524529c.tar.bz2 uhd-2d424a54fcb2c183441dbb96c39c63b80524529c.zip |
mpm: Refactor PeriphManager classes
- Sort methods by functional groups
- Removed some cruft
Diffstat (limited to 'mpm/python/usrp_mpm/periph_manager/n310.py')
-rw-r--r-- | mpm/python/usrp_mpm/periph_manager/n310.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/mpm/python/usrp_mpm/periph_manager/n310.py b/mpm/python/usrp_mpm/periph_manager/n310.py index 8e23b6e74..8ca5c9f80 100644 --- a/mpm/python/usrp_mpm/periph_manager/n310.py +++ b/mpm/python/usrp_mpm/periph_manager/n310.py @@ -431,18 +431,22 @@ class n310(PeriphManagerBase): ########################################################################### def __init__(self, args): super(n310, self).__init__(args) - self._device_initialized = False + if not self._device_initialized: + # Don't try and figure out what's going on. Just give up. + return self._tear_down = False self._status_monitor_thread = None self._ext_clock_freq = None self._clock_source = None self._time_source = None self._available_endpoints = list(range(256)) + self._initialization_error = None try: self._init_peripherals(args) - self._device_initialized = True except Exception as ex: self.log.error("Failed to initialize motherboard: %s", str(ex)) + self._initialization_status = str(ex) + self._device_initialized = False def _check_fpga_compat(self): " Throw an exception if the compat numbers don't match up " @@ -584,7 +588,7 @@ class n310(PeriphManagerBase): if not self._device_initialized: self.log.warning( "Cannot run init(), device was never fully initialized!") - return + return False if args.get("clock_source", "") != "": self.set_clock_source(args.get("clock_source")) if args.get("time_source", "") != "": |