Skip to content
Snippets Groups Projects
Commit 243cb6ae authored by Dónal Murray's avatar Dónal Murray
Browse files

Parse args before setting up the ports

parent eb2293f2
No related branches found
No related tags found
No related merge requests found
......@@ -68,6 +68,10 @@ class ArduinoEmulator:
if __name__ == "__main__":
try:
parser = argparse.ArgumentParser(description='Arguments to run hevserver')
parser.add_argument('-f', '--file', type=str, default = os.path.dirname(__file__)+'/share/dump.dump', help='File to load from')
args = parser.parse_args()
# set up and link interfaces
logging.debug("Setting up devices")
socat = Popen(f"/usr/bin/env socat -d -d pty,rawer,echo=0,link={str(Path.home())}/hev-sw/ttyEMU0 pty,rawer,echo=0,link={str(Path.home())}/hev-sw/ttyEMU1".split())
......@@ -77,10 +81,6 @@ if __name__ == "__main__":
# schedule async tasks
loop = asyncio.get_event_loop()
parser = argparse.ArgumentParser(description='Arguments to run hevserver')
parser.add_argument('-f', '--file', type=str, default = os.path.dirname(__file__)+'/share/dump.dump', help='File to load from')
args = parser.parse_args()
# setup serial devices
logging.info(f"Using file {args.file}")
comms = CommsLLI(loop)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment