mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Fixed bug in ledc_set_fade_with_step where returned while holding critical section.
Merges PR #515 https://github.com/espressif/esp-idf/pull/515
This commit is contained in:
parent
793003d0fa
commit
bf82b441ae
@ -541,6 +541,7 @@ esp_err_t ledc_set_fade_with_step(ledc_mode_t speed_mode, ledc_channel_t channel
|
|||||||
int duty_cur = LEDC.channel_group[speed_mode].channel[channel].duty_rd.duty_read >> LEDC_DUTY_DECIMAL_BIT_NUM;
|
int duty_cur = LEDC.channel_group[speed_mode].channel[channel].duty_rd.duty_read >> LEDC_DUTY_DECIMAL_BIT_NUM;
|
||||||
int duty_delta = target_duty > duty_cur ? target_duty - duty_cur : duty_cur - target_duty;
|
int duty_delta = target_duty > duty_cur ? target_duty - duty_cur : duty_cur - target_duty;
|
||||||
if (duty_delta == 0) {
|
if (duty_delta == 0) {
|
||||||
|
portEXIT_CRITICAL(&ledc_spinlock);
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
s_ledc_fade_rec[speed_mode][channel]->speed_mode = speed_mode;
|
s_ledc_fade_rec[speed_mode][channel]->speed_mode = speed_mode;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user