]> granicus.if.org Git - esp-idf/commit
idf_monitor: use cancellation and Console.getkey from pyserial 3.3.0+
authorIvan Grokhotkov <ivan@espressif.com>
Tue, 15 Aug 2017 08:46:22 +0000 (16:46 +0800)
committerIvan Grokhotkov <ivan@espressif.com>
Mon, 21 Aug 2017 07:58:28 +0000 (15:58 +0800)
commitd7d6f1e376ac40731edd26b93a61fda8cbc2b2a9
tree6ce51da3214f0c657b79edd2eef20760d6d1a368
parent489c523870dca4c7a5769eee0260b8f53cc4a1aa
idf_monitor: use cancellation and Console.getkey from pyserial 3.3.0+

Between 3.1.0 and 3.3.0, pyserial had thread cancellation implemented
using a select, which blocked on the stdin and an auxiliary pipe. When
thread had to be cancelled, a byte would be sent into the pipe,
unblocking stdin.

Unfortunately, this method suffers from a problem with using select on
a StreamReader (which represents the decoder wrapped around stdin).
In some cases, when the TTY sends an escape sequence in response to
an escape sequence received from serial, this escape sequence will not
be read from stdin until some key is pressed.

In https://github.com/pyserial/pyserial/commit/cab3dab, this method
was replaced with an TIOCSTI ioctl. This change makes sure we use the
new cancellation method even if the script is running with older
pyserial.
tools/idf_monitor.py