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))
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()
server.open()
server.start()
try:
- server.join(True)
- except KeyboardInterrupt: # FIXME
+ import time
+ while True: time.sleep(100)
+ except KeyboardInterrupt:
pass
if __name__ == "__main__":