bugfix(ledc):fix pwm duty setting error
@@ -203,7 +203,6 @@ esp_err_t ledc_fade_up(ledc_channel_t channel, uint8_t* flag)
p_ledc_obj[channel]->duty_p += duty_value;
}
pwm_set_duty(channel, p_ledc_obj[channel]->duty_p);
- pwm_start();
i[channel]++;
if (i[channel] == 100) {
i[channel] = 0;
@@ -235,7 +234,6 @@ esp_err_t ledc_fade_down(ledc_channel_t channel, uint8_t* flag)
p_ledc_obj[channel]->duty_p -= duty_value;
}
pwm_set_duty(channel, p_ledc_obj[channel]->duty_p);
- pwm_start();
i[channel]++;
if (i[channel] == 100) {
i[channel] = 0;
@@ -270,6 +268,7 @@ static void ledc_task(void* pvParameters)
}
}
}
+ pwm_start();
xTaskResumeAll();
vTaskDelay(LEDC_STEP_TIME / portTICK_PERIOD_MS);
}
