fix: 小智云聊修正AEC记忆+适配UI setup调整 (#1809)
* fix: 小智云聊修正AEC记忆+适配UI setup调整 * feat: 小智云聊增加双击切换AEC功能
This commit is contained in:
@ -15,11 +15,35 @@
|
||||
|
||||
#define TAG "YunliaoS3"
|
||||
|
||||
class YunliaoDisplay : public SpiLcdDisplay {
|
||||
public:
|
||||
YunliaoDisplay(esp_lcd_panel_io_handle_t io_handle,
|
||||
esp_lcd_panel_handle_t panel_handle,
|
||||
int width,
|
||||
int height,
|
||||
int offset_x,
|
||||
int offset_y,
|
||||
bool mirror_x,
|
||||
bool mirror_y,
|
||||
bool swap_xy)
|
||||
: SpiLcdDisplay(io_handle, panel_handle, width, height, offset_x, offset_y, mirror_x, mirror_y, swap_xy) {
|
||||
}
|
||||
|
||||
virtual void SetupUI() override {
|
||||
SpiLcdDisplay::SetupUI();
|
||||
auto& theme_manager = LvglThemeManager::GetInstance();
|
||||
auto theme = theme_manager.GetTheme("dark");
|
||||
if (theme != nullptr) {
|
||||
SetTheme(theme);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
class YunliaoS3 : public DualNetworkBoard {
|
||||
private:
|
||||
i2c_master_bus_handle_t codec_i2c_bus_;
|
||||
Button boot_button_;
|
||||
SpiLcdDisplay* display_;
|
||||
YunliaoDisplay* display_;
|
||||
PowerSaveTimer* power_save_timer_;
|
||||
PowerManager* power_manager_;
|
||||
|
||||
@ -83,6 +107,11 @@ class YunliaoS3 : public DualNetworkBoard {
|
||||
if (app.GetDeviceState() == kDeviceStateStarting ||
|
||||
app.GetDeviceState() == kDeviceStateWifiConfiguring) {
|
||||
SwitchNetworkType();
|
||||
}else if(app.GetDeviceState() == kDeviceStateIdle){
|
||||
bool enableAec = app.GetAecMode() == kAecOff;
|
||||
SetAecMode(enableAec);
|
||||
Settings settings("aec", true);
|
||||
settings.SetInt("mode", enableAec);
|
||||
}
|
||||
});
|
||||
boot_button_.OnMultipleClick(
|
||||
@ -133,15 +162,10 @@ class YunliaoS3 : public DualNetworkBoard {
|
||||
esp_lcd_panel_invert_color(panel, currentIpsMode);
|
||||
esp_lcd_panel_swap_xy(panel, DISPLAY_SWAP_XY);
|
||||
esp_lcd_panel_mirror(panel, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y);
|
||||
display_ = new SpiLcdDisplay(panel_io, panel, DISPLAY_WIDTH,
|
||||
display_ = new YunliaoDisplay(panel_io, panel, DISPLAY_WIDTH,
|
||||
DISPLAY_HEIGHT, DISPLAY_OFFSET_X,
|
||||
DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X,
|
||||
DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY);
|
||||
auto& theme_manager = LvglThemeManager::GetInstance();
|
||||
auto theme = theme_manager.GetTheme("dark");
|
||||
if (theme != nullptr) {
|
||||
display_->SetTheme(theme);
|
||||
}
|
||||
}
|
||||
void InitializeTools(){
|
||||
auto& mcp_server = McpServer::GetInstance();
|
||||
@ -218,7 +242,18 @@ class YunliaoS3 : public DualNetworkBoard {
|
||||
power_manager_->Enable4G();
|
||||
}
|
||||
power_manager_->OnBtLinkStatusChanged([this](bool is_connected) {
|
||||
SetAecMode(!is_connected);
|
||||
auto& app = Application::GetInstance();
|
||||
if (is_connected) {
|
||||
if (app.GetAecMode() != kAecOff) {
|
||||
SetAecMode(false);
|
||||
}
|
||||
} else {
|
||||
Settings settings("aec", false);
|
||||
int storedMode = settings.GetInt("mode", kAecOnDeviceSide);
|
||||
if (storedMode != kAecOff && app.GetAecMode() == kAecOff) {
|
||||
SetAecMode(storedMode == kAecOnDeviceSide);
|
||||
}
|
||||
}
|
||||
});
|
||||
power_manager_->InitializeBtModul();
|
||||
InitializeTools();
|
||||
|
||||
Reference in New Issue
Block a user