You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
esp32: cled.cpp.hpp — replace Arduino ledcAttach/ledcSetup/ledcWrite with IDF driver/ledc.h #3719
Line 132: ledcWrite(...) fallback when driver/ledc.h is unavailable.
Line 14: #include "fl/system/arduino.h" to reach those symbols.
Meanwhile the primary path already uses IDF LEDC (FL_CLED_HAS_LEDC → driver/ledc.h), and src/platforms/esp/32/pin_esp32_native_impl.hpp contains a complete, version-aware native LEDC implementation (ledc_timer_config + ledc_channel_config + ledc_set_duty/ledc_update_duty, including the ledc_find_suitable_duty_resolution (IDF 5.3+) vs manual-resolution fork at line ~275).
Fix
Delete the Arduino LEDC branches and the ESP_ARDUINO_VERSION_MAJOR fork from cled.cpp.hpp; make the IDF driver/ledc.h path unconditional.
Reuse the LEDC setup logic from pin_esp32_native_impl.hpp rather than duplicating it (factor a small shared helper if needed — both files configure a timer + channel + duty).
Remove the fl/system/arduino.h include.
IDF compat notes (3.x/4.x/5.x/6.x)
ledc_timer_config_t gained clk_cfg in IDF 4.x and changed default-clock enums again in 5.x (LEDC_AUTO_CLK availability) — gate with esp_version.h predicates, following what pin_esp32_native_impl.hpp already does.
ledc_find_suitable_duty_resolution is IDF 5.3+ only; keep the manual fallback.
IDF 3.x LEDC used ledc_timer_config_t::bit_num instead of duty_resolution — the idf33 leg will catch this; fork if it bites.
Acceptance criteria
No ledcAttach/ledcAttachPin/ledcSetup/ledcWrite calls and no ESP_ARDUINO_VERSION references remain under src/platforms/esp/.
CLED status LED still works on an Arduino build (the IDF LEDC driver is bundled with Arduino-ESP32, so behavior must be identical).
Activity
feat(esp32): CLED begin() uses IDF driver/ledc.h instead of Arduino L…