avrsim: update avrsim pty attr (#2343)

Signed-off-by: Georgios Karnas <kargeor@gmail.com>
This commit is contained in:
Georgios Karnas 2020-05-05 14:57:42 -07:00 committed by GitHub
parent f88117c7e4
commit 393f37dbfc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 3 deletions

View File

@ -150,9 +150,19 @@ def create_pty(ptyname):
os.symlink(os.ttyname(sfd), ptyname)
fcntl.fcntl(mfd, fcntl.F_SETFL
, fcntl.fcntl(mfd, fcntl.F_GETFL) | os.O_NONBLOCK)
old = termios.tcgetattr(mfd)
old[3] = old[3] & ~termios.ECHO
termios.tcsetattr(mfd, termios.TCSADRAIN, old)
tcattr = termios.tcgetattr(mfd)
tcattr[0] &= ~(
termios.IGNBRK | termios.BRKINT | termios.PARMRK | termios.ISTRIP |
termios.INLCR | termios.IGNCR | termios.ICRNL | termios.IXON)
tcattr[1] &= ~termios.OPOST
tcattr[3] &= ~(
termios.ECHO | termios.ECHONL | termios.ICANON | termios.ISIG |
termios.IEXTEN)
tcattr[2] &= ~(termios.CSIZE | termios.PARENB)
tcattr[2] |= termios.CS8
tcattr[6][termios.VMIN] = 0
tcattr[6][termios.VTIME] = 0
termios.tcsetattr(mfd, termios.TCSAFLUSH, tcattr)
return mfd
def main():