예제 #1
0
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))
예제 #2
0
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))
예제 #3
0
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))
예제 #4
0
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))
예제 #5
0
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}"))
예제 #6
0
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,
            ))
예제 #7
0
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)
예제 #8
0
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))
예제 #9
0
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))
예제 #10
0
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))
예제 #11
0
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}")
예제 #12
0
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}")
예제 #13
0
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))