使用定时器调节屏幕亮度

This commit is contained in:
Terrence
2025-02-14 01:15:10 +08:00
parent 9b8db4a551
commit 8ace1095e9
6 changed files with 75 additions and 34 deletions

View File

@@ -30,6 +30,9 @@ protected:
DisplayFonts fonts_;
esp_timer_handle_t backlight_timer_ = nullptr;
uint8_t current_brightness_ = 0;
void OnBacklightTimer();
void InitializeBacklight(gpio_num_t backlight_pin);
virtual void SetupUI();
@@ -43,10 +46,10 @@ public:
DisplayFonts fonts);
~LcdDisplay();
void SetChatMessage(const std::string &role, const std::string &content) override;
void SetEmotion(const std::string &emotion) override;
void SetIcon(const char* icon) override;
void SetBacklight(uint8_t brightness);
virtual void SetChatMessage(const std::string &role, const std::string &content) override;
virtual void SetEmotion(const std::string &emotion) override;
virtual void SetIcon(const char* icon) override;
virtual void SetBacklight(uint8_t brightness) override;
};
#endif // LCD_DISPLAY_H