1919system_path = ""
2020
2121# CMSIS outside of the core. Can be updated by arg
22- CMSIS_path = core_path .parent / "ArduinoModule-CMSIS" / "CMSIS_5"
22+ # CMSIS_VERSION = "CMSIS_5"
23+ CMSIS_VERSION = "CMSIS_6"
24+ CMSIS_path = core_path .parent / "ArduinoModule-CMSIS" / CMSIS_VERSION
2325CMSIS_DSPSrc_path = ""
2426
2527# Out sources files
@@ -82,7 +84,7 @@ def checkConfig(arg_core, arg_cmsis):
8284
8385 if arg_core is not None :
8486 core_path = Path (arg_core ).resolve ()
85- CMSIS_path = core_path .parent / "ArduinoModule-CMSIS" / "CMSIS_5"
87+ CMSIS_path = core_path .parent / "ArduinoModule-CMSIS" / CMSIS_VERSION
8688
8789 if not core_path .is_dir ():
8890 print (f"Could not find { core_path } " )
@@ -103,7 +105,11 @@ def checkConfig(arg_core, arg_cmsis):
103105
104106 if arg_cmsis is not None :
105107 CMSIS_path = Path (arg_cmsis ).resolve ()
106- CMSIS_DSPSrc_path = CMSIS_path / "CMSIS" / "DSP" / "Source"
108+
109+ if CMSIS_VERSION == "CMSIS_6" :
110+ CMSIS_DSPSrc_path = CMSIS_path / ".." / "CMSIS-DSP" / "Source"
111+ else :
112+ CMSIS_DSPSrc_path = CMSIS_path / "CMSIS" / "DSP" / "Source"
107113
108114
109115def printCMSISStartup (log ):
@@ -289,13 +295,16 @@ def wrap(arg_core, arg_cmsis, log):
289295 print ("CMSIS DSP generation skipped." )
290296 else :
291297 # Delete all subfolders
292- deleteFolder (CMSIS_DSP_outSrc_path / "*" )
298+ for path_object in CMSIS_DSP_outSrc_path .glob ("*" ):
299+ if path_object .is_dir ():
300+ deleteFolder (path_object )
293301 for path_object in CMSIS_DSPSrc_path .glob ("**/*" ):
294302 if path_object .is_file () and path_object .name .endswith (".c" ):
295303 dn = path_object .parent .name
296304 fn = path_object .name
297305 if dn in fn :
298306 fdn = CMSIS_DSP_outSrc_path / dn
307+ createFolder (fdn )
299308 with open (fdn / (f"{ fn } " ), "w" , newline = "\n " ) as out_file :
300309 out_file .write (
301310 dsp_file_template .render (dsp_dir = dn , dsp_name = fn )
0 commit comments