diff --git a/dts/2024/beagleconnect_freedom.overlay b/boards/beagleconnect_freedom.overlay similarity index 100% rename from dts/2024/beagleconnect_freedom.overlay rename to boards/beagleconnect_freedom.overlay diff --git a/include/mcpwm_interface.h b/include/mcpwm_interface.h index 14b8391..ebc6031 100644 --- a/include/mcpwm_interface.h +++ b/include/mcpwm_interface.h @@ -1,9 +1,10 @@ #ifndef MCPWM_INTERFACE_H #define MCPWM_INTERFACE_H -#include #include #include #include +#include + /** * @brief Motor interface */ @@ -73,6 +74,10 @@ typedef struct { uint32_t resolution_hz; /*!< MCPWM timer resolution */ } motor_mcpwm_config_t; + +#ifdef _cplusplus +extern "C" { +#endif /** * @brief Create Motor based on MCPWM peripheral * @@ -83,4 +88,7 @@ typedef struct { */ int motor_new_mcpwm_device(const motor_config_t *motor_config, const motor_mcpwm_config_t *mcpwm_config, motor_t** ret_motor); +#ifdef _cplusplus +} +#endif #endif /* MCPWM_INTERFACE_H */ diff --git a/samples/mcpwm/CMakeLists.txt b/samples/mcpwm/CMakeLists.txt index 80be145..42c4946 100644 --- a/samples/mcpwm/CMakeLists.txt +++ b/samples/mcpwm/CMakeLists.txt @@ -6,10 +6,7 @@ cmake_minimum_required(VERSION 3.13.1) find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) -project(sra_board_component) - -set(COMPONENT_ADD_INCLUDEDIRS "include" "src") -set(COMPONENT_SRCS "mcpwm_interface.c") +project(sra_board_component_example) FILE(GLOB app_sources src/*.c) target_sources(app PRIVATE ${app_sources}) diff --git a/samples/mcpwm/prj.conf b/samples/mcpwm/prj.conf index 958e4c0..80a9406 100644 --- a/samples/mcpwm/prj.conf +++ b/samples/mcpwm/prj.conf @@ -1,9 +1,2 @@ -CONFIG_ZTEST=y CONFIG_SRA_BOARD_COMPONENT=y -CONFIG_STDOUT_CONSOLE=y -CONFIG_PRINTK=y CONFIG_PWM=y -CONFIG_LOG=y -CONFIG_LOG_PRINTK=y -CONFIG_LOG_MODE_IMMEDIATE=y -CONFIG_PWM_LOG_LEVEL_DBG=y \ No newline at end of file diff --git a/subsys/sra_board_component/CMakelists.txt b/subsys/sra_board_component/CMakelists.txt index 75e9ed7..0c8bd80 100644 --- a/subsys/sra_board_component/CMakelists.txt +++ b/subsys/sra_board_component/CMakelists.txt @@ -1,3 +1,3 @@ zephyr_library() -zephyr_library_sources_ifdef(CONFIG_SRA_BOARD_COMPONENT bar_graph.c mcpwm_interface.c) -zephyr_library_sources(/drivers/pwm) \ No newline at end of file +zephyr_include_directories(../include) +zephyr_library_sources_ifdef(CONFIG_SRA_BOARD_COMPONENT bar_graph.c mcpwm_interface.c) \ No newline at end of file diff --git a/zephyr/module.yml b/zephyr/module.yml index 6d88376..6a96765 100644 --- a/zephyr/module.yml +++ b/zephyr/module.yml @@ -7,9 +7,7 @@ build: dts_root: . soc_root: . arch_root: . - #cmake: . + cmake: . kconfig: subsys/sra_board_component/Kconfig samples: - samples -tests: - - tests