Ejemplo n.º 1
0
 def remove_idle_overlay(self):
     """
     Remove idle mode overlay.
     """
     idle_overlay = self.get_idle_dt_overlay(self.device_info)
     self.log.trace("Removing Idle overlay: {}".format(idle_overlay))
     dtoverlay.rm_overlay(idle_overlay)
Ejemplo n.º 2
0
 def remove_idle_overlay(self):
     """
     Remove idle mode overlay.
     """
     idle_overlay = self.get_idle_dt_overlay(self.device_info)
     self.log.trace("Removing Idle overlay: {}".format(
         idle_overlay
     ))
     dtoverlay.rm_overlay(idle_overlay)
Ejemplo n.º 3
0
 def __init__(self, args):
     """
     Does partial initialization which loads low power idle image
     """
     super(e31x, self).__init__()
     # Start clean by removing MPM-owned overlays.
     active_overlays = self.list_active_overlays()
     mpm_overlays = self.list_owned_overlays()
     for overlay in active_overlays:
         if overlay in mpm_overlays:
             dtoverlay.rm_overlay(overlay)
     # Apply idle overlay on boot to save power until
     # an application tries to use the device.
     self.args_cached = args
     self.apply_idle_overlay()
     self._device_initialized = False
Ejemplo n.º 4
0
 def tear_down(self):
     """
     Tear down all members that need to be specially handled before
     deconstruction.
     For N310, this means the overlay.
     """
     self.log.trace("Tearing down N3xx device...")
     self._tear_down = True
     if self._device_initialized:
         self._status_monitor_thread.join(3 * N3XX_MONITOR_THREAD_INTERVAL)
         if self._status_monitor_thread.is_alive():
             self.log.error("Could not terminate monitor thread!")
     active_overlays = self.list_active_overlays()
     self.log.trace(
         "N310 has active device tree overlays: {}".format(active_overlays))
     for overlay in active_overlays:
         dtoverlay.rm_overlay(overlay)
Ejemplo n.º 5
0
Archivo: e320.py Proyecto: bpkempke/uhd
 def tear_down(self):
     """
     Tear down all members that need to be specially handled before
     deconstruction.
     For E320, this means the overlay.
     """
     self.log.trace("Tearing down E320 device...")
     self._tear_down = True
     if self._device_initialized:
         self._status_monitor_thread.join(3 * E320_MONITOR_THREAD_INTERVAL)
         if self._status_monitor_thread.is_alive():
             self.log.error("Could not terminate monitor thread! This could result in resource leaks.")
     active_overlays = self.list_active_overlays()
     self.log.trace("E320 has active device tree overlays: {}".format(
         active_overlays
     ))
     for overlay in active_overlays:
         dtoverlay.rm_overlay(overlay)
Ejemplo n.º 6
0
 def tear_down(self):
     """
     Tear down all members that need to be specially handled before
     deconstruction.
     For E310, this means the overlay.
     """
     self.log.trace("Tearing down E310 device...")
     self.dboards = []
     self.dboard.tear_down()
     self.dboard = None
     self.mboard_regs_control = None
     self._device_initialized = False
     active_overlays = self.list_active_overlays()
     self.log.trace(
         "E310 has active device tree overlays: {}".format(active_overlays))
     for overlay in active_overlays:
         dtoverlay.rm_overlay(overlay)
     self.apply_idle_overlay()
     self.log.debug("Teardown complete!")
Ejemplo n.º 7
0
 def tear_down(self):
     """
     Tear down all members that need to be specially handled before
     deconstruction.
     For E310, this means the overlay.
     """
     self.log.trace("Tearing down E310 device...")
     self._tear_down = True
     self.dboards = []
     self.dboard = None
     self.mboard_regs_control = None
     self._device_initialized = False
     active_overlays = self.list_active_overlays()
     self.log.trace("E310 has active device tree overlays: {}".format(
         active_overlays
     ))
     for overlay in active_overlays:
         dtoverlay.rm_overlay(overlay)
     self.apply_idle_overlay()
Ejemplo n.º 8
0
 def __init__(self, args):
     """
     Does partial initialization which loads low power idle image
     """
     self._time_source = None
     self._gpsd = None
     self.dboards = []
     self.dboard = None
     self.mboard_regs_control = None
     self._xport_mgrs = {}
     self._initialization_status = ""
     self._device_initialized = False
     self.args_cached = args
     # This will load the regular image to obtain all FPGA info
     super(e31x, self).__init__()
     args = self._update_default_args(args)
     # Permanently store the value from mpm.conf:
     self._do_not_reload_default = \
         str2bool(args.get("no_reload_fpga", E310_DEFAULT_DONT_RELOAD_FPGA))
     # This flag can change depending on UHD args:
     self._do_not_reload = self._do_not_reload_default
     # If we don't want to reload, we'll complete initialization now:
     if self._do_not_reload:
         try:
             self.log.info("Not reloading FPGA images!")
             self._init_normal()
         except BaseException as ex:
             self.log.error("Failed to initialize motherboard: %s", str(ex))
             self._initialization_status = str(ex)
             self._device_initialized = False
     else:  # Otherwise, put the USRP into low-power mode:
         # Start clean by removing MPM-owned overlays.
         active_overlays = self.list_active_overlays()
         mpm_overlays = self.list_owned_overlays()
         for overlay in active_overlays:
             if overlay in mpm_overlays:
                 dtoverlay.rm_overlay(overlay)
         # Apply idle overlay on boot to save power until
         # an application tries to use the device.
         self.apply_idle_overlay()
         self._device_initialized = False
     self._init_gps_sensors()