Skip to content

Commit

Permalink
fix Light_PWM backlight not works under arduino-esp32 v3.0 (IDF 5)
Browse files Browse the repository at this point in the history
  • Loading branch information
WuSiYu authored Jan 21, 2024
1 parent a055a87 commit f3c587d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lgfx/v1/platforms/esp32/Light_PWM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,11 @@ namespace lgfx
if (_cfg.invert) duty = (1 << PWM_BITS) - duty;

#if defined ( ARDUINO )
#if defined LEDC_USE_IDF_V5
ledcWrite(_cfg.pin_bl, duty);
#else
ledcWrite(_cfg.pwm_channel, duty);
#endif
#elif SOC_LEDC_SUPPORT_HS_MODE
ledc_set_duty(LEDC_HIGH_SPEED_MODE, (ledc_channel_t)_cfg.pwm_channel, duty);
ledc_update_duty(LEDC_HIGH_SPEED_MODE, (ledc_channel_t)_cfg.pwm_channel);
Expand Down

0 comments on commit f3c587d

Please sign in to comment.