eric6/MicroPython/EspDevices.py

changeset 7174
de8175253dfc
parent 7173
f611c3b7313f
child 7229
53054eb5b15a
diff -r f611c3b7313f -r de8175253dfc eric6/MicroPython/EspDevices.py
--- a/eric6/MicroPython/EspDevices.py	Mon Aug 26 12:43:26 2019 +0200
+++ b/eric6/MicroPython/EspDevices.py	Mon Aug 26 18:41:48 2019 +0200
@@ -137,6 +137,8 @@
                              self.__flashAddons)
         act.setEnabled(not connected)
         menu.addSeparator()
+        act = menu.addAction(self.tr("Reset Device"), self.__resetDevice)
+        menu.addSeparator()
         menu.addAction(self.tr("Install 'esptool.py'"), self.__installEspTool)
     
     @pyqtSlot()
@@ -220,6 +222,16 @@
                 dlg.exec_()
     
     @pyqtSlot()
+    def __resetDevice(self):
+        """
+        Private slot to reset the connected device.
+        """
+        self.microPython.commandsInterface().execute([
+            "import machine",
+            "machine.reset()",
+        ])
+    
+    @pyqtSlot()
     def __installEspTool(self):
         """
         Private slot to install the esptool package via pip.

eric ide

mercurial