sn 固定前缀

This commit is contained in:
Dongly 2024-06-18 09:43:54 +08:00
parent ea8c32594c
commit 0af2878317
2 changed files with 30 additions and 1 deletions

28
.vscode/tasks.json vendored Normal file
View File

@ -0,0 +1,28 @@
{
"tasks": [
{
"type": "cppbuild",
"label": "C/C++: gcc-13 生成活动文件",
"command": "/usr/bin/gcc-13",
"args": [
"-fdiagnostics-color=always",
"-g",
"${file}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}"
],
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "调试器生成的任务。"
}
],
"version": "2.0.0"
}

View File

@ -17,7 +17,7 @@ def input_one_sn():
return 0
else:
try:
return int(sn)
return int("142404"+sn)
except ValueError:
print("输入的不是数字,请重新输入。")
return input_one_sn()
@ -64,6 +64,7 @@ def write_multi_eeprom(
print("SN is 0 or -1. Do NOT need update EEPROM")
continue
if is_eeprom_initialized:
if is_force:
rc = ece.ecWriteSN(c_int(i), c_uint32(sn[i-1]))
else:
print(f"i ={i}, eeprom_file:{eeprome_file},sn: {sn[i-1]}")