-Remove linker file generation from template Fixes: PINDSW-7103 Signed-off-by: Achala Ram <a-ram@ti.com>
122 lines
3.2 KiB
JavaScript
122 lines
3.2 KiB
JavaScript
let path = require('path');
|
|
|
|
let device = "am243x";
|
|
|
|
const files = {
|
|
common: [
|
|
"app_sdfm.c",
|
|
"epwm_dc.c",
|
|
"epwm_drv_aux.c",
|
|
"epwm_mod.c",
|
|
"sdfm.c",
|
|
"cfg_pad.c",
|
|
"main.c",
|
|
],
|
|
};
|
|
|
|
/* Relative to where the makefile will be generated
|
|
* Typically at <example_folder>/<BOARD>/<core_os_combo>/<compiler>
|
|
*/
|
|
const filedirs = {
|
|
common: [
|
|
"..", /* core_os_combo base */
|
|
"../../..", /* Example base */
|
|
],
|
|
};
|
|
|
|
const libdirs_freertos = {
|
|
common: [
|
|
"${MOTOR_CONTROL_SDK_PATH}/mcu_plus_sdk/source/kernel/freertos/lib",
|
|
"${MOTOR_CONTROL_SDK_PATH}/mcu_plus_sdk/source/drivers/lib",
|
|
"${MOTOR_CONTROL_SDK_PATH}/mcu_plus_sdk/source/board/lib",
|
|
"${MOTOR_CONTROL_SDK_PATH}/source/current_sense/sdfm/lib",
|
|
],
|
|
};
|
|
|
|
const includes_freertos_r5f = {
|
|
common: [
|
|
"${MOTOR_CONTROL_SDK_PATH}/mcu_plus_sdk/source/kernel/freertos/FreeRTOS-Kernel/include",
|
|
"${MOTOR_CONTROL_SDK_PATH}/mcu_plus_sdk/source/kernel/freertos/portable/TI_ARM_CLANG/ARM_CR5F",
|
|
"${MOTOR_CONTROL_SDK_PATH}/mcu_plus_sdk/source/kernel/freertos/config/am243x/r5f",
|
|
"${MOTOR_CONTROL_SDK_PATH}/source/current_sense/sdfm/include",
|
|
"${MOTOR_CONTROL_SDK_PATH}/examples/current_sense/icss_sdfm",
|
|
],
|
|
};
|
|
|
|
const libs_freertos_r5f = {
|
|
common: [
|
|
"freertos.am243x.r5f.ti-arm-clang.${ConfigName}.lib",
|
|
"drivers.am243x.r5f.ti-arm-clang.${ConfigName}.lib",
|
|
"board.am243x.r5f.ti-arm-clang.${ConfigName}.lib",
|
|
"motorcontrol_sdfm.am243x.r5f.ti-arm-clang.${ConfigName}.lib",
|
|
],
|
|
};
|
|
|
|
|
|
const lnkfiles = {
|
|
common: [
|
|
"linker.cmd",
|
|
]
|
|
};
|
|
|
|
const syscfgfile = "../example.syscfg";
|
|
|
|
const readmeDoxygenPageTag = "EXAMPLE_MOTORCONTROL_SDFM";
|
|
|
|
const templates_freertos_r5f =
|
|
[
|
|
{
|
|
input: ".project/templates/am243x/freertos/main_freertos.c.xdt",
|
|
output: "../main.c",
|
|
options: {
|
|
entryFunction: "sdfm_main",
|
|
},
|
|
}
|
|
];
|
|
|
|
const buildOptionCombos = [
|
|
{ device: device, cpu: "r5fss0-0", cgt: "ti-arm-clang", board: "am243x-evm", os: "freertos"},
|
|
{ device: device, cpu: "r5fss0-0", cgt: "ti-arm-clang", board: "am243x-lp", os: "freertos"},
|
|
];
|
|
|
|
function getComponentProperty() {
|
|
let property = {};
|
|
|
|
property.dirPath = path.resolve(__dirname, "..");
|
|
property.type = "executable";
|
|
property.name = "icss_sdfm";
|
|
property.isInternal = false;
|
|
property.buildOptionCombos = buildOptionCombos;
|
|
property.isSkipTopLevelBuild = false;
|
|
|
|
return property;
|
|
}
|
|
|
|
function getComponentBuildProperty(buildOption) {
|
|
let build_property = {};
|
|
|
|
build_property.files = files;
|
|
build_property.filedirs = filedirs;
|
|
build_property.lnkfiles = lnkfiles;
|
|
build_property.syscfgfile = syscfgfile;
|
|
build_property.readmeDoxygenPageTag = readmeDoxygenPageTag;
|
|
|
|
if(buildOption.cpu.match(/r5f*/)) {
|
|
if(buildOption.os.match(/freertos*/) )
|
|
{
|
|
build_property.includes = includes_freertos_r5f;
|
|
build_property.libdirs = libdirs_freertos;
|
|
build_property.libs = libs_freertos_r5f;
|
|
build_property.templates = templates_freertos_r5f;
|
|
|
|
}
|
|
}
|
|
|
|
return build_property;
|
|
}
|
|
|
|
module.exports = {
|
|
getComponentProperty,
|
|
getComponentBuildProperty,
|
|
};
|