Skip to content

Commit

Permalink
fix(ledc): Fixing free_channel for > 8 supported channels
Browse files Browse the repository at this point in the history
  • Loading branch information
P-R-O-C-H-Y committed Feb 19, 2024
1 parent 1acdd78 commit 651d19f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cores/esp32/esp32-hal-ledc.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ bool ledcAttachChannel(uint8_t pin, uint32_t freq, uint8_t resolution, uint8_t c

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

0 comments on commit 651d19f

Please sign in to comment.