Check if TFT_BCKL is defined before using

This commit is contained in:
fvanroie 2021-02-23 23:14:25 +01:00
parent 301af99dd6
commit abb69ce5dd
2 changed files with 10 additions and 2 deletions

View File

@ -16,9 +16,13 @@ class Esp32Device : public BaseDevice {
Esp32Device() Esp32Device()
{ {
_hostname = "plate"; _hostname = "plate";
_backlight_pin = TFT_BCKL;
_backlight_power = 1; _backlight_power = 1;
_backlight_level = 100; _backlight_level = 100;
#ifdef TFT_BCKL
_backlight_pin = TFT_BCKL;
#else
_backlight_pin = -1;
#endif
} }
void reboot() override; void reboot() override;
void show_info() override; void show_info() override;

View File

@ -17,9 +17,13 @@ class Esp8266Device : public BaseDevice {
Esp8266Device() Esp8266Device()
{ {
_hostname = "plate"; _hostname = "plate";
_backlight_pin = TFT_BCKL;
_backlight_power = 1; _backlight_power = 1;
_backlight_level = 100; _backlight_level = 100;
#ifdef TFT_BCKL
_backlight_pin = TFT_BCKL;
#else
_backlight_pin = -1;
#endif
} }
void reboot() override; void reboot() override;