mirror of
https://github.com/78/xiaozhi-esp32.git
synced 2026-02-18 09:58:09 +00:00
- Bumped uart-eth-modem version from ~0.3.2 to ~0.3.3 in idf_component.yml. - Added SetupUI method to various display classes to ensure proper UI initialization before usage. - Improved error handling in display classes to prevent issues when UI is not set up. - Ensured UI customization is performed in SetupUI rather than constructors for better reliability.
42 lines
1.2 KiB
C++
42 lines
1.2 KiB
C++
#ifndef OLED_DISPLAY_H
|
|
#define OLED_DISPLAY_H
|
|
|
|
#include "lvgl_display.h"
|
|
|
|
#include <esp_lcd_panel_io.h>
|
|
#include <esp_lcd_panel_ops.h>
|
|
|
|
|
|
class OledDisplay : public LvglDisplay {
|
|
private:
|
|
esp_lcd_panel_io_handle_t panel_io_ = nullptr;
|
|
esp_lcd_panel_handle_t panel_ = nullptr;
|
|
|
|
lv_obj_t* top_bar_ = nullptr;
|
|
lv_obj_t* status_bar_ = nullptr;
|
|
lv_obj_t* content_ = nullptr;
|
|
lv_obj_t* content_left_ = nullptr;
|
|
lv_obj_t* content_right_ = nullptr;
|
|
lv_obj_t* container_ = nullptr;
|
|
lv_obj_t* side_bar_ = nullptr;
|
|
lv_obj_t *emotion_label_ = nullptr;
|
|
lv_obj_t* chat_message_label_ = nullptr;
|
|
|
|
virtual bool Lock(int timeout_ms = 0) override;
|
|
virtual void Unlock() override;
|
|
|
|
void SetupUI_128x64();
|
|
void SetupUI_128x32();
|
|
|
|
public:
|
|
OledDisplay(esp_lcd_panel_io_handle_t panel_io, esp_lcd_panel_handle_t panel, int width, int height, bool mirror_x, bool mirror_y);
|
|
~OledDisplay();
|
|
|
|
virtual void SetupUI() override;
|
|
virtual void SetChatMessage(const char* role, const char* content) override;
|
|
virtual void SetEmotion(const char* emotion) override;
|
|
virtual void SetTheme(Theme* theme) override;
|
|
};
|
|
|
|
#endif // OLED_DISPLAY_H
|