src/eric7/MicroPython/Devices/GenericMicroPythonDevices.py

branch
mpy_network
changeset 9989
286c2a21f36f
parent 9906
39daf45010c8
child 10069
435cc5875135
--- a/src/eric7/MicroPython/Devices/GenericMicroPythonDevices.py	Mon Apr 24 17:51:11 2023 +0200
+++ b/src/eric7/MicroPython/Devices/GenericMicroPythonDevices.py	Thu Apr 27 17:59:09 2023 +0200
@@ -249,7 +249,7 @@
         Private slot to switch the board into 'bootloader' mode.
         """
         if self.microPython.isConnected():
-            self.microPython.deviceInterface().execute(
+            self.executeCommands(
                 "import machine\nmachine.bootloader()\n", mode=self._submitMode
             )
             # simulate pressing the disconnect button
@@ -334,11 +334,12 @@
         """
         Private slot to reset the connected device.
         """
-        self.microPython.deviceInterface().execute(
-            "import machine\nmachine.reset()\n", mode=self._submitMode
-        )
-        # simulate pressing the disconnect button
-        self.microPython.on_connectButton_clicked()
+        if self.microPython.isConnected():
+            self.executeCommands(
+                "import machine\nmachine.reset()\n", mode=self._submitMode
+            )
+            # simulate pressing the disconnect button
+            self.microPython.on_connectButton_clicked()
 
     def getDocumentationUrl(self):
         """

eric ide

mercurial