Skip to content

Commit

Permalink
fix(ledc): Fix freeing channel if not used anymore (#10094)
Browse files Browse the repository at this point in the history
  • Loading branch information
P-R-O-C-H-Y authored Jul 31, 2024
1 parent 3a7eda1 commit 3722dba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cores/esp32/esp32-hal-ledc.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ static bool ledcDetachBus(void *bus) {
bool channel_found = false;
// Check if more pins are attached to the same ledc channel
for (uint8_t i = 0; i < SOC_GPIO_PIN_COUNT; i++) {
if (!perimanPinIsValid(i)) {
continue; //invalid pin, skip
if (!perimanPinIsValid(i) || i == handle->pin) {
continue; //invalid pin or same pin
}
peripheral_bus_type_t type = perimanGetPinBusType(i);
if (type == ESP32_BUS_TYPE_LEDC) {
Expand Down

0 comments on commit 3722dba

Please sign in to comment.