From 32e9ac204a58e6324c029af143ac953de4a22414 Mon Sep 17 00:00:00 2001 From: vowstar Date: Fri, 1 May 2015 18:35:30 +0800 Subject: [PATCH] Fix PWM init bug, set all initial duty to 0. --- app/driver/pwm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/driver/pwm.c b/app/driver/pwm.c index cc147d05..c34f1437 100644 --- a/app/driver/pwm.c +++ b/app/driver/pwm.c @@ -365,7 +365,7 @@ pwm_init(uint16 freq, uint16 *duty) for (i = 0; i < PWM_CHANNEL; i++) { // pwm_gpio |= (1 << pwm_out_io_num[i]); pwm_gpio = 0; - pwm.duty[0] = 0; + pwm.duty[i] = 0; } pwm_set_freq(500, 0);