diff --git a/mtda/main.py b/mtda/main.py index 47d37aea..8fdb58a5 100644 --- a/mtda/main.py +++ b/mtda/main.py @@ -917,8 +917,14 @@ def _target_off(self, session=None): self.exec_power_off_script() result = True + + # cut power and wait a few seconds before shutting down + # our interfaces (keyboard, console, USB gadget, etc.) if self.power_controller is not None: result = self.power_controller.off() + time.sleep(3) + + # shutdown our gadgets if self.keyboard is not None: self.keyboard.idle() if self.console_logger is not None: @@ -926,6 +932,8 @@ def _target_off(self, session=None): if result is True: self.console_logger.pause() self._composite_stop() + + # send power-off event to clients self._power_event(CONSTS.POWER.OFF) self.mtda.debug(3, "main._target_off(): {}".format(result))