未验证 提交 2c6a279a 编写于 作者: mysterywolf's avatar mysterywolf 提交者: GitHub

[pwm] 优化pwm框架 (#5857)

上级 acc04fac
...@@ -8,9 +8,6 @@ ...@@ -8,9 +8,6 @@
* 2018-05-07 aozima the first version * 2018-05-07 aozima the first version
*/ */
#include <string.h>
#include <stdlib.h>
#include <drivers/rt_drv_pwm.h> #include <drivers/rt_drv_pwm.h>
static rt_err_t _pwm_control(rt_device_t dev, int cmd, void *args) static rt_err_t _pwm_control(rt_device_t dev, int cmd, void *args)
...@@ -194,12 +191,9 @@ rt_err_t rt_pwm_get(struct rt_device_pwm *device, struct rt_pwm_configuration *c ...@@ -194,12 +191,9 @@ rt_err_t rt_pwm_get(struct rt_device_pwm *device, struct rt_pwm_configuration *c
} }
#ifdef RT_USING_FINSH #ifdef RT_USING_FINSH
#include <stdlib.h>
#include <finsh.h> #include <finsh.h>
FINSH_FUNCTION_EXPORT_ALIAS(rt_pwm_enable, pwm_enable, enable pwm by channel.);
FINSH_FUNCTION_EXPORT_ALIAS(rt_pwm_set, pwm_set, set pwm.);
#ifdef RT_USING_FINSH
static int pwm_enable(int argc, char **argv) static int pwm_enable(int argc, char **argv)
{ {
int result = 0; int result = 0;
...@@ -325,4 +319,3 @@ _exit: ...@@ -325,4 +319,3 @@ _exit:
MSH_CMD_EXPORT(pwm_get, pwm_get <pwm_dev> <channel>); MSH_CMD_EXPORT(pwm_get, pwm_get <pwm_dev> <channel>);
#endif /* RT_USING_FINSH */ #endif /* RT_USING_FINSH */
#endif /* RT_USING_FINSH */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册