Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: GlasgowEmbedded/glasgow
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: c3dee7d6a1eb
Choose a base ref
...
head repository: GlasgowEmbedded/glasgow
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: aed67d3d2e2f
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Sep 30, 2019

  1. applet.interface.uart: remove tty --cr.

    It looks like the default mode (no --cr) only ever works by accident,
    so let's get rid of it instead. (But maybe I'm wrong? Unix TTY is
    not my strong point.)
    whitequark committed Sep 30, 2019
    Copy the full SHA
    aed67d3 View commit details
Showing with 3 additions and 7 deletions.
  1. +3 −7 software/glasgow/applet/interface/uart/__init__.py
10 changes: 3 additions & 7 deletions software/glasgow/applet/interface/uart/__init__.py
Original file line number Diff line number Diff line change
@@ -196,9 +196,6 @@ def add_interact_arguments(cls, parser):

p_tty = p_operation.add_parser(
"tty", help="connect UART to stdin/stdout")
p_tty.add_argument(
"--cr", action="store_true", default=False,
help="send carriage return as CR, not LF")
p_tty.add_argument(
"-s", "--stream", action="store_true", default=False,
help="continue reading from I/O port even after an end-of-file condition on stdin")
@@ -273,7 +270,7 @@ async def _forward(self, in_fileno, out_fileno, uart, quit_sequence=False, strea
if fut is not None and not fut.done():
fut.cancel()

async def _interact_tty(self, uart, stream, cr):
async def _interact_tty(self, uart, stream):
in_fileno = sys.stdin.fileno()
out_fileno = sys.stdout.fileno()

@@ -283,8 +280,7 @@ async def _interact_tty(self, uart, stream, cr):
old_stdin_attrs = termios.tcgetattr(sys.stdin)
[iflag, oflag, cflag, lflag, ispeed, ospeed, cc] = old_stdin_attrs
lflag &= ~(termios.ECHO | termios.ICANON | termios.ISIG)
if cr:
iflag &= ~termios.ICRNL
iflag &= ~termios.ICRNL
cc[termios.VMIN] = 1
new_stdin_attrs = [iflag, oflag, cflag, lflag, ispeed, ospeed, cc]
termios.tcsetattr(in_fileno, termios.TCSADRAIN, new_stdin_attrs)
@@ -333,7 +329,7 @@ async def interact(self, device, args, uart):
asyncio.ensure_future(self._monitor_errors(device))

if args.operation == "tty":
await self._interact_tty(uart, args.stream, args.cr)
await self._interact_tty(uart, args.stream)
if args.operation == "pty":
await self._interact_pty(uart)
if args.operation == "socket":