466 @pyqtSlot() |
466 @pyqtSlot() |
467 def __resetDevice(self): |
467 def __resetDevice(self): |
468 """ |
468 """ |
469 Private slot to reset the connected device. |
469 Private slot to reset the connected device. |
470 """ |
470 """ |
471 self.microPython.deviceInterface().execute( |
471 if self.microPython.isConnected(): |
472 "import machine\nmachine.reset()\n", mode=self._submitMode |
472 self.executeCommands( |
473 ) |
473 "import machine\nmachine.reset()\n", mode=self._submitMode |
|
474 ) |
474 |
475 |
475 |
476 |
476 def createDevice(microPythonWidget, deviceType, vid, pid, boardName, serialNumber): |
477 def createDevice(microPythonWidget, deviceType, vid, pid, boardName, serialNumber): |
477 """ |
478 """ |
478 Function to instantiate a MicroPython device object. |
479 Function to instantiate a MicroPython device object. |