forked from xiaozhi/xiaozhi-esp32
Switch to 2.0 branch (#1152)
* Adapt boards to v2 partition tables * fix esp log error * fix display style * reset emotion after download assets * fix compiling * update assets default url * Add user only tools * Add image cache * smaller cache and buffer, more heap * use MAIN_EVENT_CLOCK_TICK to avoid audio glitches * bump to 2.0.0 * fix compiling errors --------- Co-authored-by: Xiaoxia <terrence.huang@tenclass.com>
This commit is contained in:
@@ -8,6 +8,9 @@
|
||||
#include <font_emoji.h>
|
||||
|
||||
#include <atomic>
|
||||
#include <memory>
|
||||
|
||||
#define PREVIEW_IMAGE_DURATION_MS 5000
|
||||
|
||||
// Theme color structure
|
||||
struct ThemeColors {
|
||||
@@ -34,8 +37,10 @@ protected:
|
||||
lv_obj_t* container_ = nullptr;
|
||||
lv_obj_t* side_bar_ = nullptr;
|
||||
lv_obj_t* preview_image_ = nullptr;
|
||||
lv_obj_t* emoji_image_ = nullptr;
|
||||
lv_obj_t* emoji_box_ = nullptr;
|
||||
esp_timer_handle_t preview_timer_ = nullptr;
|
||||
|
||||
DisplayFonts fonts_;
|
||||
ThemeColors current_theme_;
|
||||
|
||||
void SetupUI();
|
||||
@@ -44,12 +49,11 @@ protected:
|
||||
|
||||
protected:
|
||||
// 添加protected构造函数
|
||||
LcdDisplay(esp_lcd_panel_io_handle_t panel_io, esp_lcd_panel_handle_t panel, DisplayFonts fonts, int width, int height);
|
||||
LcdDisplay(esp_lcd_panel_io_handle_t panel_io, esp_lcd_panel_handle_t panel, int width, int height, DisplayStyle style);
|
||||
|
||||
public:
|
||||
~LcdDisplay();
|
||||
virtual void SetEmotion(const char* emotion) override;
|
||||
virtual void SetIcon(const char* icon) override;
|
||||
virtual void SetPreviewImage(const lv_img_dsc_t* img_dsc) override;
|
||||
#if CONFIG_USE_WECHAT_MESSAGE_STYLE
|
||||
virtual void SetChatMessage(const char* role, const char* content) override;
|
||||
@@ -59,13 +63,22 @@ public:
|
||||
virtual void SetTheme(const std::string& theme_name) override;
|
||||
};
|
||||
|
||||
// SPI LCD显示器
|
||||
class SpiLcdDisplay : public LcdDisplay {
|
||||
public:
|
||||
SpiLcdDisplay(esp_lcd_panel_io_handle_t panel_io, esp_lcd_panel_handle_t panel,
|
||||
int width, int height, int offset_x, int offset_y,
|
||||
bool mirror_x, bool mirror_y, bool swap_xy,
|
||||
DisplayStyle style);
|
||||
};
|
||||
|
||||
// RGB LCD显示器
|
||||
class RgbLcdDisplay : public LcdDisplay {
|
||||
public:
|
||||
RgbLcdDisplay(esp_lcd_panel_io_handle_t panel_io, esp_lcd_panel_handle_t panel,
|
||||
int width, int height, int offset_x, int offset_y,
|
||||
bool mirror_x, bool mirror_y, bool swap_xy,
|
||||
DisplayFonts fonts);
|
||||
DisplayStyle style);
|
||||
};
|
||||
|
||||
// MIPI LCD显示器
|
||||
@@ -74,33 +87,7 @@ public:
|
||||
MipiLcdDisplay(esp_lcd_panel_io_handle_t panel_io, esp_lcd_panel_handle_t panel,
|
||||
int width, int height, int offset_x, int offset_y,
|
||||
bool mirror_x, bool mirror_y, bool swap_xy,
|
||||
DisplayFonts fonts);
|
||||
DisplayStyle style);
|
||||
};
|
||||
|
||||
// // SPI LCD显示器
|
||||
class SpiLcdDisplay : public LcdDisplay {
|
||||
public:
|
||||
SpiLcdDisplay(esp_lcd_panel_io_handle_t panel_io, esp_lcd_panel_handle_t panel,
|
||||
int width, int height, int offset_x, int offset_y,
|
||||
bool mirror_x, bool mirror_y, bool swap_xy,
|
||||
DisplayFonts fonts);
|
||||
};
|
||||
|
||||
// QSPI LCD显示器
|
||||
class QspiLcdDisplay : public LcdDisplay {
|
||||
public:
|
||||
QspiLcdDisplay(esp_lcd_panel_io_handle_t panel_io, esp_lcd_panel_handle_t panel,
|
||||
int width, int height, int offset_x, int offset_y,
|
||||
bool mirror_x, bool mirror_y, bool swap_xy,
|
||||
DisplayFonts fonts);
|
||||
};
|
||||
|
||||
// MCU8080 LCD显示器
|
||||
class Mcu8080LcdDisplay : public LcdDisplay {
|
||||
public:
|
||||
Mcu8080LcdDisplay(esp_lcd_panel_io_handle_t panel_io, esp_lcd_panel_handle_t panel,
|
||||
int width, int height, int offset_x, int offset_y,
|
||||
bool mirror_x, bool mirror_y, bool swap_xy,
|
||||
DisplayFonts fonts);
|
||||
};
|
||||
#endif // LCD_DISPLAY_H
|
||||
|
||||
Reference in New Issue
Block a user