Skip to content

Commit 7acd875

Browse files
authored
fix(ledc): Match channel number with groups (espressif#9638)
1 parent 3d92ede commit 7acd875

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cores/esp32/esp32-hal-ledc.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ bool ledcAttachChannel(uint8_t pin, uint32_t freq, uint8_t resolution, uint8_t c
9292
return false;
9393
}
9494

95-
uint32_t duty = ledc_get_duty(group, channel);
95+
uint32_t duty = ledc_get_duty(group, (channel % 8));
9696

9797
ledc_channel_config_t ledc_channel = {
9898
.speed_mode = group, .channel = (channel % 8), .timer_sel = timer, .intr_type = LEDC_INTR_DISABLE, .gpio_num = pin, .duty = duty, .hpoint = 0

0 commit comments

Comments
 (0)