Skip to content

Commit 201cb29

Browse files
authored
Merge pull request #26 from misonyo/rttdev
[更新]更新示例代码
2 parents d0f90c2 + bc8200b commit 201cb29

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

pwm_led_sample.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#include <rtthread.h>
1818
#include <rtdevice.h>
1919

20-
#define LED_PIN_NUM 57 /* LED PIN脚编号,查看驱动文件drv_gpio.c确定 */
2120
#define PWM_DEV_NAME "pwm3" /* PWM设备名称 */
2221
#define PWM_DEV_CHANNEL 4 /* PWM通道 */
2322

@@ -31,11 +30,6 @@ static int pwm_led_sample(int argc, char *argv[])
3130
dir = 1; /* PWM脉冲宽度值的增减方向 */
3231
pulse = 0; /* PWM脉冲宽度值,单位为纳秒ns */
3332

34-
/* 设置LED引脚脚模式为输出 */
35-
rt_pin_mode(LED_PIN_NUM, PIN_MODE_OUTPUT);
36-
/* 拉高LED引脚 */
37-
rt_pin_write(LED_PIN_NUM, PIN_HIGH);
38-
3933
/* 查找设备 */
4034
pwm_dev = (struct rt_device_pwm *)rt_device_find(PWM_DEV_NAME);
4135
if (pwm_dev == RT_NULL)

0 commit comments

Comments
 (0)