Skip to content

Commit 53835a3

Browse files
iabdalkaderdpgeorge
authored andcommitted
toolkit: Add serial port arg for most tools.
Add `--port` arg to `maintenance.py`, `updateSystemPackage.py` and `app-write-mram.py` Signed-off-by: iabdalkader <[email protected]>
1 parent 980d883 commit 53835a3

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

toolkit/app-write-mram.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@ def main():
146146
default=False,
147147
help="COM port discovery",
148148
)
149+
parser.add_argument(
150+
"--port", type=str, help="Serial port device", default="/dev/ttyACM0"
151+
)
149152
parser.add_argument("-b", "--baudrate", help="serial port baud rate", type=int)
150153
parser.add_argument(
151154
"-e",
@@ -370,7 +373,7 @@ def main():
370373
if args.discover: # discover the COM ports if requested
371374
isp.discoverSerialPorts()
372375

373-
errorCode = isp.openSerial()
376+
errorCode = isp.openSerial(args.port)
374377
if errorCode is False:
375378
print("[ERROR] isp openSerial failed for %s" % isp.getPort())
376379
sys.exit(EXIT_WITH_ERROR)

toolkit/maintenance.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,9 @@ def main():
727727

728728
# Deal with Command Line
729729
parser = argparse.ArgumentParser(description="FUSION Maintenance Tool")
730+
parser.add_argument(
731+
"--port", type=str, help="Serial port device", default="/dev/ttyACM0"
732+
)
730733
parser.add_argument("-b", "--baudrate", help="serial port baud rate", type=int)
731734
parser.add_argument(
732735
"-d",
@@ -782,7 +785,7 @@ def main():
782785
print("Discover")
783786
isp.discoverSerialPorts()
784787

785-
errorCode = isp.openSerial()
788+
errorCode = isp.openSerial(args.port)
786789
if errorCode is False:
787790
print("[ERROR] isp openSerial failed for %s" % isp.getPort())
788791
sys.exit(EXIT_WITH_ERROR)

toolkit/updateSystemPackage.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ def main():
8585
default=False,
8686
help="COM port discovery for ISP",
8787
)
88+
parser.add_argument(
89+
"--port", type=str, help="Serial port device", default="/dev/ttyACM0"
90+
)
8891
parser.add_argument(
8992
"-b", "--baudrate", help="(isp) serial port baud rate", type=int
9093
)
@@ -153,7 +156,7 @@ def main():
153156
if args.discover: # discover the COM ports if requested
154157
isp.discoverSerialPorts()
155158

156-
errorCode = isp.openSerial()
159+
errorCode = isp.openSerial(args.port)
157160
if errorCode is False:
158161
print("[ERROR] isp openSerial failed for %s" % isp.getPort())
159162
sys.exit(EXIT_WITH_ERROR)

0 commit comments

Comments
 (0)