1
0
forked from M-Labs/kirdy

gui: await for hard rst and dfu action

This commit is contained in:
linuswck 2024-09-10 16:06:39 +08:00
parent 0d64d62fb0
commit 76f7875e3a

View File

@ -563,15 +563,15 @@ class MainWindow(QtWidgets.QMainWindow):
) )
self.menu_action_about_gui.triggered.connect(about_gui) self.menu_action_about_gui.triggered.connect(about_gui)
@pyqtSlot(bool) @asyncSlot(bool)
def dfu_mode(_): async def dfu_mode(_):
self.kirdy.task_dispatcher(self.kirdy.device.dfu()) await self.kirdy.device.dfu()
self.kirdy_handler.end_session() self.kirdy_handler.end_session()
self.menu_action_dfu_mode.triggered.connect(dfu_mode) self.menu_action_dfu_mode.triggered.connect(dfu_mode)
@pyqtSlot(bool) @asyncSlot(bool)
def reset_kirdy(_): async def reset_kirdy(_):
self.kirdy.task_dispatcher(self.kirdy.device.hard_reset()) await self.kirdy.device.hard_reset()
self.kirdy_handler.end_session() self.kirdy_handler.end_session()
self.menu_action_hard_reset.triggered.connect(reset_kirdy) self.menu_action_hard_reset.triggered.connect(reset_kirdy)