mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-24 11:46:34 +00:00
Move defines to hasp_conf.h
This commit is contained in:
parent
9a940b2bcd
commit
04d970f529
@ -8,6 +8,15 @@
|
||||
// language specific defines
|
||||
#include "lang/lang.h"
|
||||
|
||||
// TFT defines
|
||||
#ifndef TFT_BACKLIGHT_ON
|
||||
#define TFT_BACKLIGHT_ON LOW
|
||||
#endif
|
||||
|
||||
#ifndef TFT_BCKL
|
||||
#define TFT_BCKL -1
|
||||
#endif
|
||||
|
||||
#define HASP_USE_APP 1
|
||||
|
||||
#ifndef HASP_USE_DEBUG
|
||||
@ -34,6 +43,10 @@
|
||||
#define HASP_USE_MQTT (HASP_HAS_NETWORK)
|
||||
#endif
|
||||
|
||||
#ifndef MQTT_NODENAME
|
||||
#define MQTT_NODENAME "plate"
|
||||
#endif
|
||||
|
||||
#ifndef HASP_USE_HTTP
|
||||
#define HASP_USE_HTTP (HASP_HAS_NETWORK)
|
||||
#endif
|
||||
|
@ -4,22 +4,11 @@
|
||||
#ifndef HASP_DEVICE_ESP32_H
|
||||
#define HASP_DEVICE_ESP32_H
|
||||
|
||||
#include "hasp_conf.h"
|
||||
#include "../device.h"
|
||||
|
||||
#if defined(ESP32)
|
||||
|
||||
#ifndef TFT_BACKLIGHT_ON
|
||||
#define TFT_BACKLIGHT_ON LOW
|
||||
#endif
|
||||
|
||||
#ifndef MQTT_NODENAME
|
||||
#define MQTT_NODENAME "plate"
|
||||
#endif
|
||||
|
||||
#ifndef TFT_BCKL
|
||||
#define TFT_BCKL -1
|
||||
#endif
|
||||
|
||||
namespace dev {
|
||||
|
||||
class Esp32Device : public BaseDevice {
|
||||
|
@ -16,16 +16,12 @@ class Esp8266Device : public BaseDevice {
|
||||
public:
|
||||
Esp8266Device()
|
||||
{
|
||||
_hostname = "plate";
|
||||
_hostname = MQTT_NODENAME;
|
||||
_backlight_invert = (TFT_BACKLIGHT_ON == LOW);
|
||||
_backlight_power = 1;
|
||||
_backlight_invert = 0;
|
||||
_backlight_level = 100;
|
||||
_core_version = ESP.getCoreVersion().c_str();
|
||||
#ifdef TFT_BCKL
|
||||
_backlight_pin = TFT_BCKL;
|
||||
#else
|
||||
_backlight_pin = -1;
|
||||
#endif
|
||||
_backlight_pin = TFT_BCKL;
|
||||
}
|
||||
|
||||
void reboot() override;
|
||||
|
@ -16,15 +16,11 @@ class Stm32f4Device : public BaseDevice {
|
||||
public:
|
||||
Stm32f4Device()
|
||||
{
|
||||
_hostname = "plate";
|
||||
_hostname = MQTT_NODENAME;
|
||||
_backlight_power = 1;
|
||||
_backlight_invert = 0;
|
||||
_backlight_level = 100;
|
||||
#ifdef TFT_BCKL
|
||||
_backlight_pin = TFT_BCKL;
|
||||
#else
|
||||
_backlight_pin = -1;
|
||||
#endif
|
||||
_backlight_pin = TFT_BCKL;
|
||||
}
|
||||
|
||||
void reboot() override;
|
||||
|
Loading…
x
Reference in New Issue
Block a user