def copyCortosUtilFiles(confObj: config.SystemConfig, ) -> None: with open(consts.CORTOS_UTILS_H_FILE_NAME, "w") as f: f.write( btl.template(f"utils/{consts.CORTOS_UTILS_H_FILE_NAME}", confObj=confObj)) with open(consts.CORTOS_UTILS_C_FILE_NAME, "w") as f: f.write( btl.template(f"utils/{consts.CORTOS_UTILS_C_FILE_NAME}", confObj=confObj)) with open(consts.CORTOS_UTILS_ASM_FILE_NAME, "w") as f: f.write( btl.template(f"utils/{consts.CORTOS_UTILS_ASM_FILE_NAME}", confObj=confObj)) with open(consts.CORTOS_PRINTF_FILE_NAME, "w") as f: f.write( btl.template(f"utils/{consts.CORTOS_PRINTF_FILE_NAME}", confObj=confObj)) with open(consts.CORTOS_PRINTF_CVT_FILE_NAME, "w") as f: f.write( btl.template(f"utils/{consts.CORTOS_PRINTF_CVT_FILE_NAME}", confObj=confObj))
def copyCortosDeviceFiles(confObj: config.SystemConfig) -> None: with open(consts.CORTOS_DEVICE_C_FILE, "w") as f: f.write( btl.template(f"devices/{consts.CORTOS_DEVICE_C_FILE}", confObj=confObj)) with open(consts.CORTOS_DEVICE_H_FILE, "w") as f: f.write( btl.template(f"devices/{consts.CORTOS_DEVICE_H_FILE}", confObj=confObj))
def copyLockFiles(confObj: config.SystemConfig, ) -> None: with open(consts.LOCK_FILE_NAME, "w") as f: f.write(btl.template(f"locks/{consts.LOCK_FILE_NAME}", confObj=confObj)) with open(consts.LOCKS_C_FILE, "w") as f: f.write(btl.template(f"locks/{consts.LOCKS_C_FILE}", confObj=confObj)) with open(consts.LOCKS_HEADER_FILE, "w") as f: f.write( btl.template(f"locks/{consts.LOCKS_HEADER_FILE}", confObj=confObj))
def copyCortosLoggingFiles(confObj: config.SystemConfig) -> None: with open(consts.CORTOS_LOGGING_C_FILE, "w") as f: f.write( btl.template(f"logging/{consts.CORTOS_LOGGING_C_FILE}", confObj=confObj)) with open(consts.CORTOS_LOGGING_H_FILE, "w") as f: f.write( btl.template(f"logging/{consts.CORTOS_LOGGING_H_FILE}", confObj=confObj, consts=consts))
def copyTrapFiles(confObj: config.SystemConfig, ) -> None: with open(consts.TRAP_H_FILE_NAME, "w") as f: f.write(btl.template(f"traps/{consts.TRAP_H_FILE_NAME}")) with open(consts.TRAP_C_FILE_NAME, "w") as f: f.write( btl.template( f"traps/{consts.TRAP_C_FILE_NAME}", confObj=confObj, )) with open(consts.TRAP_ASM_FILE_NAME, "w") as f: f.write(btl.template(f"traps/{consts.TRAP_ASM_FILE_NAME}")) with open(consts.TRAP_RTOS_FILE_NAME, "w") as f: f.write(btl.template(f"traps/{consts.TRAP_RTOS_FILE_NAME}"))
def copyCortosHeaderFile(confObj: config.SystemConfig, ) -> None: with open(consts.CORTOS_HEADER_FILE_NAME, "w") as f: f.write( btl.template( f"api/{consts.CORTOS_HEADER_FILE_NAME}", confObj=confObj, consts=consts, LogLevel=consts.LogLevel, ))
def copyResultsFile(confObj: config.SystemConfig) -> None: # Get user defined results if not confObj.software.projectFiles.resultsFile: return userResults = "" resFilePath = osp.join(confObj.software.projectFiles.rootDir, confObj.software.projectFiles.resultsFile) if osp.exists(resFilePath): userResults = f"{util.readFromFile(resFilePath).strip()}\n" # Add results to append appendResults = btl.template(f"{consts.DEFAULT_RESULTS_FILE_NAME}", confObj=confObj) with open(consts.DEFAULT_RESULTS_FILE_NAME, "w") as f: f.write(userResults) f.write(appendResults)
def copyCortosBgetFiles(confObj: config.SystemConfig) -> None: with open(consts.CORTOS_BGET_C_FILE, "w") as f: f.write( btl.template(f"bget/{consts.CORTOS_BGET_C_FILE}", confObj=confObj, bgetLockIndex=consts.BGET_RES_LOCK_INDEX)) with open(consts.CORTOS_BGET_H_FILE, "w") as f: f.write( btl.template(f"bget/{consts.CORTOS_BGET_H_FILE}", confObj=confObj)) with open(consts.BGET_C_FILE, "w") as f: f.write(btl.template(f"bget/{consts.BGET_C_FILE}", confObj=confObj)) with open(consts.BGET_H_FILE, "w") as f: f.write(btl.template(f"bget/{consts.BGET_H_FILE}", confObj=confObj)) with open(consts.BGET_C_FILE_NCRAM, "w") as f: f.write( btl.template(f"bget/{consts.BGET_C_FILE_NCRAM}", confObj=confObj)) with open(consts.BGET_H_FILE_NCRAM, "w") as f: f.write( btl.template(f"bget/{consts.BGET_H_FILE_NCRAM}", confObj=confObj))
def copyLinkerScriptFile(confObj: config.SystemConfig, ) -> None: with open(consts.LINKER_SCRIPT_FILE_NAME, "w") as f: f.write( btl.template(f"linker/{consts.LINKER_SCRIPT_FILE_NAME}", confObj=confObj))
def copyCortosQueueFiles(confObj: config.SystemConfig) -> None: with open(consts.QUEUE_H_FILE, "w") as f: f.write(btl.template(f"queue/{consts.QUEUE_H_FILE}", confObj=confObj)) with open(consts.QUEUE_C_FILE, "w") as f: f.write(btl.template(f"queue/{consts.QUEUE_C_FILE}", confObj=confObj))
def copyRunCModelFile(confObj: config.SystemConfig) -> None: with open(consts.RUN_CMODEL_FILE_NAME, "w") as f: f.write( btl.template(f"run_sh/{consts.RUN_CMODEL_FILE_NAME}", confObj=confObj)) util.runCommand(f"chmod +x {consts.RUN_CMODEL_FILE_NAME}")
def copyCleanshFile(confObj: config.SystemConfig, ) -> None: with open(consts.CLEAN_SH_FILE_NAME, "w") as f: f.write( btl.template(f"build_sh/{consts.CLEAN_SH_FILE_NAME}", confObj=confObj)) util.runCommand(f"chmod +x {consts.CLEAN_SH_FILE_NAME}")
def copyInitFile(confObj: config.SystemConfig, ) -> None: with open(consts.INIT_FILE_NAME, "w") as f: f.write(btl.template(f"init/{consts.INIT_FILE_NAME}", confObj=confObj))