Skip to content

Commit b37a764

Browse files
Update cores/esp32/esp32-hal-ledc.c
Co-authored-by: Lucas Saavedra Vaz <32426024+lucasssvaz@users.noreply.github.com>
1 parent 42bf774 commit b37a764

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

cores/esp32/esp32-hal-ledc.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,10 @@ static bool find_matching_timer(uint8_t speed_mode, uint32_t freq, uint8_t resol
5656
peripheral_bus_type_t type = perimanGetPinBusType(i);
5757
if (type == ESP32_BUS_TYPE_LEDC) {
5858
ledc_channel_handle_t *bus = (ledc_channel_handle_t *)perimanGetPinBus(i, ESP32_BUS_TYPE_LEDC);
59-
if (bus != NULL && (bus->channel / 8) == speed_mode) {
60-
if (bus->freq_hz == freq && bus->channel_resolution == resolution) {
61-
log_d("Found matching timer %u for freq=%u, resolution=%u", bus->timer_num, freq, resolution);
62-
*timer_num = bus->timer_num;
63-
return true;
64-
}
59+
if (bus != NULL && (bus->channel / 8) == speed_mode && bus->freq_hz == freq && bus->channel_resolution == resolution) {
60+
log_d("Found matching timer %u for freq=%u, resolution=%u", bus->timer_num, freq, resolution);
61+
*timer_num = bus->timer_num;
62+
return true;
6563
}
6664
}
6765
}

0 commit comments

Comments
 (0)