aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xscripts/avrsim.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/scripts/avrsim.py b/scripts/avrsim.py
index a48aeee7..bbf97e87 100755
--- a/scripts/avrsim.py
+++ b/scripts/avrsim.py
@@ -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():