Skip to content

Commit 651d19f

Browse files
committed
fix(ledc): Fixing free_channel for > 8 supported channels
1 parent 1acdd78 commit 651d19f

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
@@ -131,7 +131,7 @@ bool ledcAttachChannel(uint8_t pin, uint32_t freq, uint8_t resolution, uint8_t c
131131

132132
bool ledcAttach(uint8_t pin, uint32_t freq, uint8_t resolution)
133133
{
134-
uint8_t free_channel = ~ledc_handle.used_channels & (ledc_handle.used_channels+1);
134+
int free_channel = ~ledc_handle.used_channels & (ledc_handle.used_channels+1);
135135
if (free_channel == 0){
136136
log_e("No more LEDC channels available! (maximum is %u channels)", LEDC_CHANNELS);
137137
return false;

0 commit comments

Comments
 (0)