8000 Fix LEDC channels above 8 not properly clearing · judge2005/arduino-esp32@6dab3f6 · GitHub
[go: up one dir, main page]

Skip to content
< 8000 header class="HeaderMktg header-logged-out js-details-container js-header Details f4 py-3" role="banner" data-is-top="true" data-color-mode=light data-light-theme=light data-dark-theme=dark>

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6dab3f6

Browse files
committed
Fix LEDC channels above 8 not properly clearing
Fixes: espressif#2660
1 parent 1efcd21 commit 6dab3f6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cores/esp32/esp32-hal-ledc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ static void _ledcSetupChannel(uint8_t chan, uint8_t idle_level)
167167
LEDC_CHAN(group, channel).conf0.sig_out_en = 0;//This is the output enable control bit for channel
168168
LEDC_CHAN(group, channel).conf1.duty_start = 0;//When duty_num duty_cycle and duty_scale has been configured. these register won't take effect until set duty_start. this bit is automatically cleared by hardware.
169169
if(group) {
170-
LEDC_CHAN(group, channel).conf0.val &= ~BIT(4);
170+
LEDC_CHAN(group, channel).conf0.low_speed_update = 1;
171171
} else {
172172
LEDC_CHAN(group, channel).conf0.clk_en = 0;
173173
}
@@ -196,15 +196,15 @@ void ledcWrite(uint8_t chan, uint32_t duty)
196196
LEDC_CHAN(group, channel).conf0.sig_out_en = 1;//This is the output enable control bit for channel
197197
LEDC_CHAN(group, channel).conf1.duty_start = 1;//When duty_num duty_cycle and duty_scale has been configured. these register won't take effect until set duty_start. this bit is automatically cleared by hardware.
198198
if(group) {
199-
LEDC_CHAN(group, channel).conf0.val |= BIT(4);
199+
LEDC_CHAN(group, channel).conf0.low_speed_update = 1;
200200
} else {
201201
LEDC_CHAN(group, channel).conf0.clk_en = 1;
202202
}
203203
} else {
204204
LEDC_CHAN(group, channel).conf0.sig_out_en = 0;//This is the output enable control bit for channel
205205
LEDC_CHAN(group, channel).conf1.duty_start = 0;//When duty_num duty_cycle and duty_scale has been configured. these register won't take effect until set duty_start. this bit is automatically cleared by hardware.
206206
if(group) {
207-
LEDC_CHAN(group, channel).conf0.val &= ~BIT(4);
207+
LEDC_CHAN(group, channel).conf0.low_speed_update = 1;
208208
} else {
209209
LEDC_CHAN(group, channel).conf0.clk_en = 0;
210210
}

0 commit comments

Comments
 (0)
0