eric6/MicroPython/MicroPythonDevices.py

branch
micropython
changeset 7065
e3d04faced34
parent 7061
9db5a73217bb
child 7068
e3200e4dfa63
equal deleted inserted replaced
7062:ac12da95958b 7065:e3d04faced34
11 from __future__ import unicode_literals 11 from __future__ import unicode_literals
12 12
13 import logging 13 import logging
14 import os 14 import os
15 15
16 from PyQt5.QtCore import QObject 16 from PyQt5.QtCore import pyqtSlot, QObject
17 17
18 import UI.PixmapCache 18 import UI.PixmapCache
19 import Preferences 19 import Preferences
20 20
21 21
282 rawOn = [ # sequence of commands to enter raw mode 282 rawOn = [ # sequence of commands to enter raw mode
283 b'\x02', # Ctrl-B: exit raw repl (just in case) 283 b'\x02', # Ctrl-B: exit raw repl (just in case)
284 b'\r\x03\x03', # Ctrl-C twice: interrupt any running program 284 b'\r\x03\x03', # Ctrl-C twice: interrupt any running program
285 b'\r\x01', # Ctrl-A: enter raw REPL 285 b'\r\x01', # Ctrl-A: enter raw REPL
286 ] 286 ]
287 newLine = [b'print("\\n")\r',] 287 newLine = [b'print("\\n")\r', ]
288 commands = [c.encode("utf-8)") + b'\r' for c in commandsList] 288 commands = [c.encode("utf-8)") + b'\r' for c in commandsList]
289 commands.append(b'\r') 289 commands.append(b'\r')
290 commands.append(b'\x04') 290 commands.append(b'\x04')
291 rawOff = [b'\x02'] 291 rawOff = [b'\x02']
292 commandSequence = rawOn + newLine + commands + rawOff 292 commandSequence = rawOn + newLine + commands + rawOff
293 self.microPython.execute(commandSequence) 293 self.microPython.execute(commandSequence)
294
295 @pyqtSlot()
296 def handleDataFlood(self):
297 """
298 Public slot handling a data floof from the device.
299 """
300 pass

eric ide

mercurial