mirror of
https://github.com/espressif/ESP8266_RTOS_SDK.git
synced 2025-05-22 09:37:00 +08:00
bugfix(ledc):fix pwm duty setting error
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user