src/eric7/MicroPython/Devices/GenericMicroPythonDevices.py

branch
mpy_network
changeset 9989
286c2a21f36f
parent 9906
39daf45010c8
child 10069
435cc5875135
equal deleted inserted replaced
9988:1ba9d07ba9da 9989:286c2a21f36f
247 def __activateBootloader(self): 247 def __activateBootloader(self):
248 """ 248 """
249 Private slot to switch the board into 'bootloader' mode. 249 Private slot to switch the board into 'bootloader' mode.
250 """ 250 """
251 if self.microPython.isConnected(): 251 if self.microPython.isConnected():
252 self.microPython.deviceInterface().execute( 252 self.executeCommands(
253 "import machine\nmachine.bootloader()\n", mode=self._submitMode 253 "import machine\nmachine.bootloader()\n", mode=self._submitMode
254 ) 254 )
255 # simulate pressing the disconnect button 255 # simulate pressing the disconnect button
256 self.microPython.on_connectButton_clicked() 256 self.microPython.on_connectButton_clicked()
257 257
332 @pyqtSlot() 332 @pyqtSlot()
333 def __resetDevice(self): 333 def __resetDevice(self):
334 """ 334 """
335 Private slot to reset the connected device. 335 Private slot to reset the connected device.
336 """ 336 """
337 self.microPython.deviceInterface().execute( 337 if self.microPython.isConnected():
338 "import machine\nmachine.reset()\n", mode=self._submitMode 338 self.executeCommands(
339 ) 339 "import machine\nmachine.reset()\n", mode=self._submitMode
340 # simulate pressing the disconnect button 340 )
341 self.microPython.on_connectButton_clicked() 341 # simulate pressing the disconnect button
342 self.microPython.on_connectButton_clicked()
342 343
343 def getDocumentationUrl(self): 344 def getDocumentationUrl(self):
344 """ 345 """
345 Public method to get the device documentation URL. 346 Public method to get the device documentation URL.
346 347

eric ide

mercurial