mirror of
https://github.com/78/xiaozhi-esp32.git
synced 2025-05-17 23:28:09 +08:00
fixbug: bread-compact-wifi-lcd no backlight
This commit is contained in:
@ -147,9 +147,10 @@ private:
|
||||
void InitializeIot() {
|
||||
auto& thing_manager = iot::ThingManager::GetInstance();
|
||||
thing_manager.AddThing(iot::CreateThing("Speaker"));
|
||||
#if DISPLAY_BACKLIGHT_PIN != GPIO_NUM_NC
|
||||
thing_manager.AddThing(iot::CreateThing("Backlight"));
|
||||
#endif
|
||||
thing_manager.AddThing(iot::CreateThing("Lamp"));
|
||||
if (DISPLAY_BACKLIGHT_PIN != GPIO_NUM_NC) {
|
||||
thing_manager.AddThing(iot::CreateThing("Backlight"));
|
||||
}
|
||||
}
|
||||
|
||||
public:
|
||||
@ -159,10 +160,10 @@ public:
|
||||
InitializeLcdDisplay();
|
||||
InitializeButtons();
|
||||
InitializeIot();
|
||||
if (DISPLAY_BACKLIGHT_PIN != GPIO_NUM_NC) {
|
||||
GetBacklight()->RestoreBrightness();
|
||||
}
|
||||
|
||||
#if DISPLAY_BACKLIGHT_PIN != GPIO_NUM_NC
|
||||
GetBacklight()->RestoreBrightness();
|
||||
#endif
|
||||
}
|
||||
|
||||
virtual Led* GetLed() override {
|
||||
@ -185,12 +186,13 @@ public:
|
||||
return display_;
|
||||
}
|
||||
|
||||
#if DISPLAY_BACKLIGHT_PIN != GPIO_NUM_NC
|
||||
virtual Backlight* GetBacklight() override {
|
||||
static PwmBacklight backlight(DISPLAY_BACKLIGHT_PIN, DISPLAY_BACKLIGHT_OUTPUT_INVERT);
|
||||
return &backlight;
|
||||
if (DISPLAY_BACKLIGHT_PIN != GPIO_NUM_NC) {
|
||||
static PwmBacklight backlight(DISPLAY_BACKLIGHT_PIN, DISPLAY_BACKLIGHT_OUTPUT_INVERT);
|
||||
return &backlight;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
DECLARE_BOARD(CompactWifiBoardLCD);
|
||||
|
Reference in New Issue
Block a user