Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

- Remove unnecessary include statements in mcpwm_interface.h #1

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion include/mcpwm_interface.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#ifndef MCPWM_INTERFACE_H
#define MCPWM_INTERFACE_H
#include <zephyr/zephyr.h>
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/logging/log.h>
#include <zephyr/drivers/pwm.h>

/**
* @brief Motor interface
*/
Expand Down Expand Up @@ -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
*
Expand All @@ -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 */
5 changes: 1 addition & 4 deletions samples/mcpwm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
7 changes: 0 additions & 7 deletions samples/mcpwm/prj.conf
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions subsys/sra_board_component/CMakelists.txt
Original file line number Diff line number Diff line change
@@ -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)
zephyr_include_directories(../include)
zephyr_library_sources_ifdef(CONFIG_SRA_BOARD_COMPONENT bar_graph.c mcpwm_interface.c)
4 changes: 1 addition & 3 deletions zephyr/module.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ build:
dts_root: .
soc_root: .
arch_root: .
#cmake: .
cmake: .
kconfig: subsys/sra_board_component/Kconfig
samples:
- samples
tests:
- tests