forked from xiaozhi/xiaozhi-esp32
[优化]-jiuchuan-s3-优化电源管理架构 (#875)
* 添加 jiuchuang-s3 开发板支持 * 增加编译指南 * 优开发板支持包文件目录,更新README.md 删除了多余板载文件 [* ]README.md -> 更新了编译指南和烧录指南 * 修改板级支持包名 * 使用乐鑫提供的电源监测 * 修复部分代码格式问题 * 解决合并冲突 * 解决部分合并内容 * 完善合并内容 * 修复电量映射表错误 * 优化电源管理架构-使用rtc-io电源保持 --------- Co-authored-by: unknown <jake12355> Co-authored-by: Hangon66 <2630612613@qq.com>
This commit is contained in:
@@ -2,16 +2,19 @@
|
||||
#include <mutex>
|
||||
#include <functional>
|
||||
#include <driver/gpio.h>
|
||||
#include <driver/rtc_io.h>
|
||||
#include <esp_log.h>
|
||||
|
||||
class PowerController {
|
||||
public:
|
||||
enum class PowerState {
|
||||
#include "config.h"
|
||||
enum class PowerState {
|
||||
ACTIVE,
|
||||
LIGHT_SLEEP,
|
||||
DEEP_SLEEP,
|
||||
SHUTDOWN
|
||||
};
|
||||
|
||||
class PowerController {
|
||||
public:
|
||||
|
||||
|
||||
static PowerController& Instance() {
|
||||
static PowerController instance;
|
||||
@@ -42,7 +45,11 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
PowerController() = default;
|
||||
PowerController(){
|
||||
rtc_gpio_init(PWR_EN_GPIO);
|
||||
rtc_gpio_set_direction(PWR_EN_GPIO, RTC_GPIO_MODE_OUTPUT_ONLY);
|
||||
rtc_gpio_set_level(PWR_EN_GPIO, 1);
|
||||
}
|
||||
~PowerController() = default;
|
||||
|
||||
PowerState currentState_ = PowerState::ACTIVE;
|
||||
|
||||
Reference in New Issue
Block a user