fix audio pm (#1004)

This commit is contained in:
Xiaoxia
2025-07-29 15:25:40 +08:00
committed by GitHub
parent 345c8be467
commit e5ac40aac8
43 changed files with 124 additions and 265 deletions

View File

@@ -66,22 +66,11 @@ private:
void InitializePowerSaveTimer() {
power_save_timer_ = new PowerSaveTimer(160);
power_save_timer_->OnEnterSleepMode([this]() {
ESP_LOGI(TAG, "Enabling sleep mode");
auto display = GetDisplay();
display->SetChatMessage("system", "");
display->SetEmotion("sleepy");
GetDisplay()->SetPowerSaveMode(true);
GetBacklight()->SetBrightness(10);
auto codec = GetAudioCodec();
codec->EnableInput(false);
});
power_save_timer_->OnExitSleepMode([this]() {
auto codec = GetAudioCodec();
codec->EnableInput(true);
auto display = GetDisplay();
display->SetChatMessage("system", "");
display->SetEmotion("neutral");
GetDisplay()->SetPowerSaveMode(false);
GetBacklight()->RestoreBrightness();
});
power_save_timer_->SetEnabled(true);