mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-29 06:06:40 +00:00
Add config override option
This commit is contained in:
parent
acdfa69539
commit
52c012f5a8
1
.gitignore
vendored
1
.gitignore
vendored
@ -6,6 +6,7 @@
|
|||||||
.pio
|
.pio
|
||||||
data/*
|
data/*
|
||||||
src/user_config_override.h
|
src/user_config_override.h
|
||||||
|
platformio_override.ini
|
||||||
|
|
||||||
## Visual Studio Code specific ######
|
## Visual Studio Code specific ######
|
||||||
.vscode
|
.vscode
|
||||||
|
@ -26,6 +26,13 @@ include_dir =
|
|||||||
;lvgl
|
;lvgl
|
||||||
;png_decoder
|
;png_decoder
|
||||||
|
|
||||||
|
extra_configs = platformio_override.ini
|
||||||
|
|
||||||
|
; -- By default there are no ${override.build_flags} set
|
||||||
|
; -- to use it, copy platformio_override.ini from the template
|
||||||
|
[override]
|
||||||
|
build_flags =
|
||||||
|
|
||||||
[lcd]
|
[lcd]
|
||||||
TFT_WIDTH = 240
|
TFT_WIDTH = 240
|
||||||
TFT_HEIGHT = 320
|
TFT_HEIGHT = 320
|
||||||
@ -47,9 +54,9 @@ upload_speed = 921600
|
|||||||
; -- Shared library dependencies in all environments
|
; -- Shared library dependencies in all environments
|
||||||
lib_deps =
|
lib_deps =
|
||||||
;lvgl@^7.0.0 ; Not in library yet
|
;lvgl@^7.0.0 ; Not in library yet
|
||||||
TFT_eSPI@^1.5.0
|
TFT_eSPI@^2.0.0
|
||||||
PubSubClient@^2.7.0 ; MQTT client
|
PubSubClient@^2.7.0 ; MQTT client
|
||||||
ArduinoJson@^6.14.1 ; needs at least 6.14.1
|
ArduinoJson@^6.14.1,>6.14.0 ; needs at least 6.14.1
|
||||||
Syslog@^2.0.0
|
Syslog@^2.0.0
|
||||||
|
|
||||||
; -- littlevgl config options ----------------------
|
; -- littlevgl config options ----------------------
|
||||||
@ -61,6 +68,7 @@ build_flags =
|
|||||||
-D ARDUINOJSON_DECODE_UNICODE=1 ; for utf-8 symbols
|
-D ARDUINOJSON_DECODE_UNICODE=1 ; for utf-8 symbols
|
||||||
-D ARDUINOJSON_ENABLE_PROGMEM=1 ; for PROGMEM arguments
|
-D ARDUINOJSON_ENABLE_PROGMEM=1 ; for PROGMEM arguments
|
||||||
-I include ; include lv_conf.h and hasp_conf.h
|
-I include ; include lv_conf.h and hasp_conf.h
|
||||||
|
${override.build_flags}
|
||||||
|
|
||||||
;***************************************************
|
;***************************************************
|
||||||
; ESP32 build
|
; ESP32 build
|
||||||
|
5
platformio_override-template.ini
Normal file
5
platformio_override-template.ini
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
[override]
|
||||||
|
; -- Hasp config options ----------------------
|
||||||
|
build_flags =
|
||||||
|
; -- Use settings from file user_config_override.h
|
||||||
|
-DUSE_CONFIG_OVERRIDE
|
@ -13,7 +13,9 @@
|
|||||||
#include "hasp_debug.h"
|
#include "hasp_debug.h"
|
||||||
#include "hasp_config.h"
|
#include "hasp_config.h"
|
||||||
|
|
||||||
|
#ifdef USE_CONFIG_OVERRIDE
|
||||||
#include "user_config_override.h"
|
#include "user_config_override.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef SYSLOG_SERVER
|
#ifndef SYSLOG_SERVER
|
||||||
#define SYSLOG_SERVER ""
|
#define SYSLOG_SERVER ""
|
||||||
|
@ -18,7 +18,9 @@
|
|||||||
#include "hasp_wifi.h"
|
#include "hasp_wifi.h"
|
||||||
#include "hasp.h"
|
#include "hasp.h"
|
||||||
|
|
||||||
|
#ifdef USE_CONFIG_OVERRIDE
|
||||||
#include "user_config_override.h"
|
#include "user_config_override.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
// Size of buffer for incoming MQTT message
|
// Size of buffer for incoming MQTT message
|
||||||
#define mqttMaxPacketSize 2u * 1024u
|
#define mqttMaxPacketSize 2u * 1024u
|
||||||
|
@ -21,7 +21,10 @@ static WiFiEventHandler wifiEventHandler[3];
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
#include "DNSserver.h"
|
#include "DNSserver.h"
|
||||||
|
|
||||||
|
#ifdef USE_CONFIG_OVERRIDE
|
||||||
#include "user_config_override.h"
|
#include "user_config_override.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef WIFI_SSID
|
#ifdef WIFI_SSID
|
||||||
std::string wifiSsid = WIFI_SSID;
|
std::string wifiSsid = WIFI_SSID;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user