Skip to content

Commit

Permalink
Merge pull request #511 from WuSiYu/develop
Browse files Browse the repository at this point in the history
fix Light_PWM backlight not works under arduino-esp32 v3.0 (IDF 5)
  • Loading branch information
lovyan03 authored Jan 23, 2024
2 parents a055a87 + f3c587d commit 83c12df
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 83c12df

Please sign in to comment.