We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dc67980 commit bc8200bCopy full SHA for bc8200b
pwm_led_sample.c
@@ -17,7 +17,6 @@
17
#include <rtthread.h>
18
#include <rtdevice.h>
19
20
-#define LED_PIN_NUM 57 /* LED PIN脚编号,查看驱动文件drv_gpio.c确定 */
21
#define PWM_DEV_NAME "pwm3" /* PWM设备名称 */
22
#define PWM_DEV_CHANNEL 4 /* PWM通道 */
23
@@ -31,11 +30,6 @@ static int pwm_led_sample(int argc, char *argv[])
31
30
dir = 1; /* PWM脉冲宽度值的增减方向 */
32
pulse = 0; /* PWM脉冲宽度值,单位为纳秒ns */
33
34
- /* 设置LED引脚脚模式为输出 */
35
- rt_pin_mode(LED_PIN_NUM, PIN_MODE_OUTPUT);
36
- /* 拉高LED引脚 */
37
- rt_pin_write(LED_PIN_NUM, PIN_HIGH);
38
-
39
/* 查找设备 */
40
pwm_dev = (struct rt_device_pwm *)rt_device_find(PWM_DEV_NAME);
41
if (pwm_dev == RT_NULL)
0 commit comments