前言
IDF手册上说如果PWM的clk_cfg配置为RTC8M_CLK支持Light-Sleep模式,但是官方的Repo里面也没有如何使用这个特性的例子.
实操
经过一圈摸索.需要配置menuconfig才行
1 | idf.py menuconfig |
找到Component config->Hardware Settings -> Sleep Config, 关闭light sleep GPIO reset workaround
在esp-idf内置的LEDC (LED Controller) basic example的基础上修改,得到以下代码
1 |
|