diff --git a/pylink/jlink.py b/pylink/jlink.py index e7de9fc..9ecf065 100644 --- a/pylink/jlink.py +++ b/pylink/jlink.py @@ -955,9 +955,6 @@ def exec_command(self, cmd): def enable_dialog_boxes(self): """Enables showing dialog boxes on certain methods. - Note: - Dialog boxes only appear on Windows platforms. - Note: This can be used for batch or automized test running. @@ -968,14 +965,14 @@ def enable_dialog_boxes(self): ``None`` """ self.exec_command('SetBatchMode = 0') + self.exec_command("HideDeviceSelection = 0") + self.exec_command("EnableInfoWinFlashDL") + self.exec_command("EnableInfoWinFlashBPs") @minimum_required('5.02') def disable_dialog_boxes(self): """Disables showing dialog boxes on certain methods. - Note: - Dialog boxes only appear on Windows platforms. - Warning: This has the effect of also silencing dialog boxes that appear when updating firmware / to confirm updating firmware. @@ -994,6 +991,13 @@ def disable_dialog_boxes(self): self.exec_command('SuppressInfoUpdateFW') self.exec_command('SetBatchMode = 1') + # SuppressControlPanel + self.exec_command("HideDeviceSelection = 1") + self.exec_command("SuppressControlPanel") + # Hide Flash Windows + self.exec_command("DisableInfoWinFlashDL") + self.exec_command("DisableInfoWinFlashBPs") + @open_required def jtag_configure(self, instr_regs=0, data_bits=0): """Configures the JTAG scan chain to determine which CPU to address. diff --git a/tests/unit/test_jlink.py b/tests/unit/test_jlink.py index f52e9ed..65c863d 100644 --- a/tests/unit/test_jlink.py +++ b/tests/unit/test_jlink.py @@ -1175,7 +1175,10 @@ def test_jlink_enable_dialog_boxes(self): self.dll.JLINKARM_GetDLLVersion.return_value = 50200 self.jlink.exec_command = mock.Mock() self.jlink.enable_dialog_boxes() - self.jlink.exec_command.assert_called_with('SetBatchMode = 0') + self.jlink.exec_command.assert_any_call('SetBatchMode = 0') + self.jlink.exec_command.assert_any_call('HideDeviceSelection = 0') + self.jlink.exec_command.assert_any_call("EnableInfoWinFlashDL") + self.jlink.exec_command.assert_any_call("EnableInfoWinFlashBPs") def test_jlink_disable_dialog_boxes(self): """Tests disabling the dialog boxes shown by the DLL. @@ -1192,6 +1195,10 @@ def test_jlink_disable_dialog_boxes(self): self.jlink.exec_command.assert_any_call('SilentUpdateFW') self.jlink.exec_command.assert_any_call('SuppressInfoUpdateFW') self.jlink.exec_command.assert_any_call('SetBatchMode = 1') + self.jlink.exec_command.assert_any_call('HideDeviceSelection = 1') + self.jlink.exec_command.assert_any_call('SuppressControlPanel') + self.jlink.exec_command.assert_any_call('DisableInfoWinFlashDL') + self.jlink.exec_command.assert_any_call('DisableInfoWinFlashBPs') def test_jlink_jtag_configure(self): """Tests the J-Link ``jtag_configure()`` method.