tools/litex_term: Avoid importing termios and pty on Windows.
This commit is contained in:
parent
460fada3ac
commit
bfc624f23e
|
@ -17,7 +17,6 @@ import threading
|
||||||
import multiprocessing
|
import multiprocessing
|
||||||
import argparse
|
import argparse
|
||||||
import json
|
import json
|
||||||
import pty
|
|
||||||
import telnetlib
|
import telnetlib
|
||||||
|
|
||||||
# Console ------------------------------------------------------------------------------------------
|
# Console ------------------------------------------------------------------------------------------
|
||||||
|
@ -35,6 +34,7 @@ if sys.platform == "win32":
|
||||||
return msvcrt.getch()
|
return msvcrt.getch()
|
||||||
else:
|
else:
|
||||||
import termios
|
import termios
|
||||||
|
import pty
|
||||||
class Console:
|
class Console:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.fd = sys.stdin.fileno()
|
self.fd = sys.stdin.fileno()
|
||||||
|
@ -495,7 +495,10 @@ def main():
|
||||||
print("[LXTERM] --no-crc is deprecated and now does nothing (CRC checking is now fast)")
|
print("[LXTERM] --no-crc is deprecated and now does nothing (CRC checking is now fast)")
|
||||||
term = LiteXTerm(args.serial_boot, args.kernel, args.kernel_adr, args.images, args.flash)
|
term = LiteXTerm(args.serial_boot, args.kernel, args.kernel_adr, args.images, args.flash)
|
||||||
|
|
||||||
bridge_cls = {"crossover": CrossoverUART, "jtag_uart": JTAGUART}.get(args.port, None)
|
if sys.platform == "win32":
|
||||||
|
bridge_cls = None
|
||||||
|
else:
|
||||||
|
bridge_cls = {"crossover": CrossoverUART, "jtag_uart": JTAGUART}.get(args.port, None)
|
||||||
if bridge_cls is not None:
|
if bridge_cls is not None:
|
||||||
bridge = bridge_cls()
|
bridge = bridge_cls()
|
||||||
bridge.open()
|
bridge.open()
|
||||||
|
|
Loading…
Reference in New Issue