eric6/MicroPython/MicroPythonSerialPort.py

branch
micropython
changeset 7077
3b7475b7a1ef
parent 7070
3368ce0e7879
child 7082
ec199ef0cfc6
--- a/eric6/MicroPython/MicroPythonSerialPort.py	Sat Jul 20 14:48:09 2019 +0200
+++ b/eric6/MicroPython/MicroPythonSerialPort.py	Sun Jul 21 19:54:15 2019 +0200
@@ -10,7 +10,7 @@
 
 from __future__ import unicode_literals
 
-from PyQt5.QtCore import QIODevice, QTime
+from PyQt5.QtCore import QIODevice, QTime, QCoreApplication
 from PyQt5.QtSerialPort import QSerialPort
 
 
@@ -69,7 +69,7 @@
         """
         Public method to close the open serial connection.
         """
-        if self.__connceted:
+        if self.__connected:
             self.close()
             
             self.__connected = False
@@ -95,15 +95,12 @@
         @return bytes read from the device including the expected sequence
         @rtype bytes
         """
-        from PyQt5.QtCore import QCoreApplication, QEventLoop
         data = bytearray()
         
         t = QTime()
         t.start()
         while True:
-            # TODO: check if this is still needed when used with a QThread
-            QCoreApplication.processEvents(QEventLoop.ExcludeUserInputEvents)
-##            if self.waitForReadyRead(self.__timeout):
+            QCoreApplication.processEvents()
             c = bytes(self.read(1))
             if c:
                 data += c
@@ -115,7 +112,5 @@
 #                break
             if t.elapsed() > self.__timeout:
                 break
-##            else:
-##                break
         
         return bytes(data)

eric ide

mercurial