From 1884649de1900c0a8e0aa0d0d1852dfc255b4da5 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Tue, 6 Aug 2019 08:46:25 +0200 Subject: [PATCH] litex_term: make sure to unconfigure console when board is unplugged --- litex/tools/litex_term.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/litex/tools/litex_term.py b/litex/tools/litex_term.py index 1cd9a5131..a075615e3 100755 --- a/litex/tools/litex_term.py +++ b/litex/tools/litex_term.py @@ -268,6 +268,7 @@ class LiteXTerm: except serial.SerialException: self.reader_alive = False + self.console.unconfigure() raise def start_reader(self): @@ -292,6 +293,7 @@ class LiteXTerm: self.port.write(b) except: self.writer_alive = False + self.console.unconfigure() raise def start_writer(self): @@ -334,8 +336,8 @@ def _get_args(): def main(): args = _get_args() term = LiteXTerm(args.serial_boot, args.kernel, args.kernel_adr, args.images) - term.console.configure() term.open(args.port, int(float(args.speed))) + term.console.configure() term.start() term.join(True)