Add config override option

This commit is contained in:
fvanroie 2020-01-29 22:47:50 +01:00
parent acdfa69539
commit 52c012f5a8
6 changed files with 23 additions and 2 deletions

1
.gitignore vendored
View File

@ -6,6 +6,7 @@
.pio
data/*
src/user_config_override.h
platformio_override.ini
## Visual Studio Code specific ######
.vscode

View File

@ -26,6 +26,13 @@ include_dir =
;lvgl
;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]
TFT_WIDTH = 240
TFT_HEIGHT = 320
@ -47,9 +54,9 @@ upload_speed = 921600
; -- Shared library dependencies in all environments
lib_deps =
;lvgl@^7.0.0 ; Not in library yet
TFT_eSPI@^1.5.0
TFT_eSPI@^2.0.0
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
; -- littlevgl config options ----------------------
@ -61,6 +68,7 @@ build_flags =
-D ARDUINOJSON_DECODE_UNICODE=1 ; for utf-8 symbols
-D ARDUINOJSON_ENABLE_PROGMEM=1 ; for PROGMEM arguments
-I include ; include lv_conf.h and hasp_conf.h
${override.build_flags}
;***************************************************
; ESP32 build

View File

@ -0,0 +1,5 @@
[override]
; -- Hasp config options ----------------------
build_flags =
; -- Use settings from file user_config_override.h
-DUSE_CONFIG_OVERRIDE

View File

@ -13,7 +13,9 @@
#include "hasp_debug.h"
#include "hasp_config.h"
#ifdef USE_CONFIG_OVERRIDE
#include "user_config_override.h"
#endif
#ifndef SYSLOG_SERVER
#define SYSLOG_SERVER ""

View File

@ -18,7 +18,9 @@
#include "hasp_wifi.h"
#include "hasp.h"
#ifdef USE_CONFIG_OVERRIDE
#include "user_config_override.h"
#endif
// Size of buffer for incoming MQTT message
#define mqttMaxPacketSize 2u * 1024u

View File

@ -21,7 +21,10 @@ static WiFiEventHandler wifiEventHandler[3];
#endif
#include "DNSserver.h"
#ifdef USE_CONFIG_OVERRIDE
#include "user_config_override.h"
#endif
#ifdef WIFI_SSID
std::string wifiSsid = WIFI_SSID;