|
24 | 24 | getRepoBranchName, |
25 | 25 | commitFiles, |
26 | 26 | loadSTM32Series, |
| 27 | + addSeriesToConfig, |
27 | 28 | ) |
28 | 29 |
|
29 | 30 | if sys.platform.startswith("win32"): |
@@ -138,7 +139,7 @@ def checkConfig(): |
138 | 139 | else: |
139 | 140 | defaultConfig(config_file_path, {"REPO_LOCAL_PATH": str(repo_local_path)}) |
140 | 141 | createFolder(repo_local_path) |
141 | | - stm32_dict = loadSTM32Series(script_path) |
| 142 | + stm32_dict = loadSTM32Series(script_path, True, False) |
142 | 143 |
|
143 | 144 |
|
144 | 145 | def updateStm32Def(series): |
@@ -903,17 +904,6 @@ def updateOpenAmp(): |
903 | 904 | copyFolder(OpenAmp_cube_path, OpenAmp_core_path) |
904 | 905 |
|
905 | 906 |
|
906 | | -def addSeriesToConfig(series, nx): |
907 | | - stm32_series_file = stm32_series_json_path / "stm32_series.json" |
908 | | - with open(stm32_series_file, "r") as fp: |
909 | | - stm32_series_data = json.load(fp) |
910 | | - if series not in stm32_series_data: |
911 | | - stm32_series_data["series"][series] = nx |
912 | | - with open(stm32_series_file, "w") as fp: |
913 | | - json.dump(stm32_series_data, fp, indent=2) |
914 | | - print(f"Added series {series} with nx={nx} to stm32_series.json") |
915 | | - |
916 | | - |
917 | 907 | def updateCore(): |
918 | 908 | global nx |
919 | 909 | for series in stm32_list: |
@@ -1046,7 +1036,7 @@ def updateCore(): |
1046 | 1036 | print("No stm32_def file were updated!") |
1047 | 1037 | sys.exit(1) |
1048 | 1038 | # Add the new series to the json config file |
1049 | | - addSeriesToConfig(series, nx) |
| 1039 | + addSeriesToConfig(stm32_series_json_path, series, nx, "series") |
1050 | 1040 | if not commitFiles(core_path, series_commit_msg): |
1051 | 1041 | print("No stm32_series.json file were updated!") |
1052 | 1042 |
|
|
0 commit comments