Skip to content
Prev Previous commit
Next Next commit
ci(pre-commit): Apply automatic fixes
  • Loading branch information
pre-commit-ci-lite[bot] authored Aug 27, 2025
commit 6c24deeeae1e6b37e8949f2534c0531eceb2ab49
4 changes: 2 additions & 2 deletions cores/esp32/esp32-hal-ledc.c
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ void analogWrite(uint8_t pin, int value) {

void analogWriteFrequency(uint8_t pin, uint32_t freq) {
ledc_channel_handle_t *bus = (ledc_channel_handle_t *)perimanGetPinBus(pin, ESP32_BUS_TYPE_LEDC);
if (bus != NULL) { // if pin is attached to LEDC change frequency, otherwise update the global frequency
if (bus != NULL) { // if pin is attached to LEDC change frequency, otherwise update the global frequency
if (ledcChangeFrequency(pin, freq, analog_resolution) == 0) {
log_e("analogWrite frequency cant be set due to selected resolution! Try to adjust resolution first");
return;
Expand All @@ -796,7 +796,7 @@ void analogWriteFrequency(uint8_t pin, uint32_t freq) {

void analogWriteResolution(uint8_t pin, uint8_t resolution) {
ledc_channel_handle_t *bus = (ledc_channel_handle_t *)perimanGetPinBus(pin, ESP32_BUS_TYPE_LEDC);
if (bus != NULL) { // if pin is attached to LEDC change resolution, otherwise update the global resolution
if (bus != NULL) { // if pin is attached to LEDC change resolution, otherwise update the global resolution
if (ledcChangeFrequency(pin, analog_frequency, resolution) == 0) {
log_e("analogWrite resolution cant be set due to selected frequency! Try to adjust frequency first");
return;
Expand Down