mfg_tool: add manualcode format

This commit is contained in:
InfiniteYuan
2023-05-12 14:25:28 +08:00
parent 193af51aa7
commit 73265e4c95
2 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -391,7 +391,7 @@ def organize_output_files(suffix, args):
def generate_summary(args):
master_csv = os.sep.join([OUT_DIR['stage'], 'master.csv'])
summary_csv = os.sep.join([OUT_DIR['top'], 'summary-{}.csv'.format(datetime.now().strftime("%Y-%m-%d-%H:%M:%S"))])
summary_csv = os.sep.join([OUT_DIR['top'], 'summary-{}.csv'.format(datetime.now().strftime("%Y-%m-%d-%H-%M-%S"))])
summary_csv_data = ''
with open(master_csv, 'r') as mcsvf:
+2
View File
@@ -333,4 +333,6 @@ def get_chip_manualcode(chip_tool, vid, pid, flow, discriminator, passcode):
# TODO: change the format of 21-digits maunal code
if manual_code_len == SHORT_MANUALCODE_LEN:
ret = ret[:4] + '-' + ret[4:7] + '-' + ret[7:]
elif manual_code_len == LONG_MANUALCODE_LEN:
ret = '"' + ret[:4] + '-' + ret[4:7] + '-' + ret[7:11] + '\n' + ret[11:15] + '-' + ret[15:18] + '-' + ret[18:20] + '-' + ret[20:21] + '"'
return ret