From 68707076208e8ac2ed44d580959ba36b9bc25d01 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Tue, 17 Nov 2015 15:31:23 +0100 Subject: [PATCH] soc/tools/remoter/server: fix exit on KeyboardInterrupt --- litex/soc/tools/remote/comm_uart.py | 2 +- litex/soc/tools/remote/server.py | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/litex/soc/tools/remote/comm_uart.py b/litex/soc/tools/remote/comm_uart.py index 06dea93d..0f20dd16 100644 --- a/litex/soc/tools/remote/comm_uart.py +++ b/litex/soc/tools/remote/comm_uart.py @@ -56,7 +56,7 @@ class CommUART: length = len(data) self._write([self.msg_type["write"], length]) self._write(list((addr//4).to_bytes(4, byteorder="big"))) - for i, value in enumerate(range(data)): + for i, value in enumerate(data): self._write(list(value.to_bytes(4, byteorder="big"))) if self.debug: print("write {:08x} @ {:08x}".format(value, addr + 4*i)) diff --git a/litex/soc/tools/remote/server.py b/litex/soc/tools/remote/server.py index f8058686..8b6e304c 100644 --- a/litex/soc/tools/remote/server.py +++ b/litex/soc/tools/remote/server.py @@ -67,10 +67,6 @@ class RemoteServer(EtherboneIPC): self.serve_thread.setDaemon(True) self.serve_thread.start() - def join(self, writer_only=False): - if not hasattr(self, "serve_thread"): - return - self.serve_thread.join() def _get_args(): parser = argparse.ArgumentParser() @@ -95,8 +91,9 @@ def main(): server.open() server.start() try: - server.join(True) - except KeyboardInterrupt: # FIXME + import time + while True: time.sleep(100) + except KeyboardInterrupt: pass if __name__ == "__main__": -- 2.30.2