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