Skip to content

[LED Indicator] Allow configuring sleep_mode in LEDC_CHANNEL_CONFIG for better light sleep power optimization (AEGHB-1079) #513

Open
@BatuhanKaratas

Description

@BatuhanKaratas

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

General issue report

Currently, the LEDC_CHANNEL_CONFIG macro does not expose the .sleep_mode field of ledc_channel_config_t, and it defaults to LEDC_SLEEP_MODE_NO_ALIVE_NO_PD. This prevents the LEDC power domain from being powered down during light sleep, increasing power consumption unnecessarily.

#define LEDC_CHANNEL_CONFIG(ledc_timer, ledc_channel, gpio)
{
.speed_mode = LEDC_MODE,
.timer_sel = ledc_timer,
.hpoint = 0,
.duty = 0,
.intr_type = LEDC_INTR_DISABLE,
.channel = ledc_channel,
.gpio_num = gpio,
}

In our case, we modified the RGB LED configuration to explicitly set:

.sleep_mode = LEDC_SLEEP_MODE_NO_ALIVE_ALLOW_PD

This significantly reduced power consumption during light sleep by allowing the TOP domain to power down. However, since the macro is fixed, similar optimizations cannot be applied in other parts of the component without local modifications.

We recommend making .sleep_mode configurable across the LED Indicator component, either by extending the macro or offering a more flexible interface.

Benefits:

Enables lower current consumption in light sleep mode

Promotes better power optimization without compromising functionality

Avoids the need for source code modifications in the component

Thank you for considering this enhancement!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions