]> granicus.if.org Git - esp-idf/commitdiff
Fixed bug in ledc_set_fade_with_step where returned while holding critical section.
authorJonathan Kaufmann <jonathankaufmann@gmail.com>
Wed, 12 Apr 2017 23:23:32 +0000 (18:23 -0500)
committerAngus Gratton <gus@projectgus.com>
Fri, 21 Apr 2017 01:03:07 +0000 (11:03 +1000)
Merges PR #515 https://github.com/espressif/esp-idf/pull/515

components/driver/ledc.c

index 7da353869f5bab1475d9442919950edfcbb579d0..239f8f33118de1cd5353ebed1071a33c31d3e46a 100644 (file)
@@ -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_delta = target_duty > duty_cur ? target_duty - duty_cur : duty_cur - target_duty;
     if (duty_delta == 0) {
+        portEXIT_CRITICAL(&ledc_spinlock);
         return ESP_OK;
     }
     s_ledc_fade_rec[speed_mode][channel]->speed_mode = speed_mode;