File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,17 @@ class Led : public BaseComponent {
3737 ledc_mode_t speed_mode{
3838 LEDC_LOW_SPEED_MODE}; /* *< The LEDC speed mode you want for this LED channel. */
3939 bool output_invert{false }; /* *< Whether to invert the GPIO output for this LED channel. */
40+ #if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 0) || defined(_DOXYGEN_)
41+ ledc_sleep_mode_t sleep_mode{
42+ LEDC_SLEEP_MODE_KEEP_ALIVE}; /* *< The LEDC sleep mode you want for this
43+ LED channel. Default is
44+ LEDC_SLEEP_MODE_KEEP_ALIVE which will
45+ keep the LEDC output when the system
46+ enters light sleep. Note that this is
47+ only useful if the LED's clock_config is
48+ set to a clock source which supports
49+ light sleep. */
50+ #endif
4051 };
4152
4253 /* *
Original file line number Diff line number Diff line change @@ -41,6 +41,9 @@ Led::Led(const Config &config) noexcept
4141 channel_conf.duty = actual_duty;
4242 channel_conf.gpio_num = conf.gpio ;
4343 channel_conf.speed_mode = conf.speed_mode ;
44+ #if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 0)
45+ channel_conf.sleep_mode = conf.sleep_mode ;
46+ #endif
4447 channel_conf.hpoint = 0 ;
4548 channel_conf.timer_sel = conf.timer ;
4649 channel_conf.flags .output_invert = conf.output_invert ;
You can’t perform that action at this time.
0 commit comments