eric6/MicroPython/MicroPythonSerialPort.py

branch
micropython
changeset 7083
217862c28319
parent 7082
ec199ef0cfc6
child 7084
3eddfc540614
equal deleted inserted replaced
7082:ec199ef0cfc6 7083:217862c28319
8 MicroPython devices. 8 MicroPython devices.
9 """ 9 """
10 10
11 from __future__ import unicode_literals 11 from __future__ import unicode_literals
12 12
13 from PyQt5.QtCore import QIODevice, QTime, QCoreApplication 13 from PyQt5.QtCore import QIODevice, QTime, QCoreApplication, QEventLoop
14 from PyQt5.QtSerialPort import QSerialPort 14 from PyQt5.QtSerialPort import QSerialPort
15 15
16 16
17 class MicroPythonSerialPort(QSerialPort): 17 class MicroPythonSerialPort(QSerialPort):
18 """ 18 """
109 self.__timedOut = False 109 self.__timedOut = False
110 110
111 t = QTime() 111 t = QTime()
112 t.start() 112 t.start()
113 while True: 113 while True:
114 QCoreApplication.processEvents() 114 QCoreApplication.processEvents(QEventLoop.ExcludeUserInputEvents)
115 c = bytes(self.read(1)) 115 c = bytes(self.read(1))
116 if c: 116 if c:
117 data += c 117 data += c
118 if data.endswith(expected): 118 if data.endswith(expected):
119 break 119 break

eric ide

mercurial