Commit 498246a9 authored by Matthieu Cattin's avatar Matthieu Cattin

test31: Move program argument read out of main function.

Was causing trouble when called from pts.
parent 021bfdf4
......@@ -42,7 +42,7 @@ test31: Fix EEPROM content:
Note: Requires test00.py to run first to load the firmware!
"""
def main (default_directory='.'):
def main (default_directory='.', offset="0x1000", filename="calibration.sdb"):
# Constants declaration
TEST_NB = 31
......@@ -62,16 +62,8 @@ def main (default_directory='.'):
NEW_EEPROM_BIN_FILENAME = os.path.join(default_directory, NEW_EEPROM_BIN_FILENAME)
EEPROM_SIZE = 8192 # in Bytes
arg_nb = len(sys.argv[1:])
if arg_nb == 2:
BAD_SDB_DIR_OFFSET = sys.argv[1]
BAD_CALIBR_BIN_FILENAME = sys.argv[2]
elif arg_nb > 2:
print("Too many arguments.")
sys.exit()
else:
BAD_SDB_DIR_OFFSET = "0x1000"
BAD_CALIBR_BIN_FILENAME = "calibration.sdb"
BAD_SDB_DIR_OFFSET = offset
BAD_CALIBR_BIN_FILENAME = filename
start_test_time = time.time()
......@@ -350,4 +342,15 @@ P1 Bank A nb signal=%d, P1 Bank B nb signal=%d, P2 Bank A nb signal=%d, P2 Bank
if __name__ == '__main__' :
main()
arg_nb = len(sys.argv[1:])
if arg_nb == 2:
offset = sys.argv[1]
filename = sys.argv[2]
elif arg_nb > 2:
print("Too many arguments.")
sys.exit()
else:
offset = "0x1000"
filename = "calibration.sdb"
main('.', offset, filename)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment