[Build] Add Custom ESP32 and disable plugins to reduce binary size

Disabled 
- Settings Archive
- NeoClock
- Candle
This commit is contained in:
Gijs Noorlander
2019-09-25 00:46:04 +02:00
parent cac026117c
commit 036743040b
4 changed files with 77 additions and 7 deletions
+31 -3
View File
@@ -413,18 +413,46 @@ board_build.f_cpu = ${common.board_build.f_cpu}
build_unflags = ${regular_platform.build_unflags}
build_flags = -Wl,-Tesp8266.flash.16m14m.ld -DSPIFFS_MAX_OPEN_FILES=20
; NORMAL: 4096k version --------------------------
; Custom: 4096k version --------------------------
[env:custom_ESP8266_4M1M]
platform = ${normal_252.platform}
platform = ${beta_platform.platform}
board = ${esp8266_4M1M.board}
board_build.f_cpu = ${esp8266_4M1M.board_build.f_cpu}
board_build.flash_mode = ${esp8266_4M1M.board_build.flash_mode}
build_unflags = ${esp8266_4M1M.build_unflags}
build_flags = ${esp8266_4M1M.build_flags} ${normal_252.build_flags} -DPLUGIN_BUILD_CUSTOM
build_flags = ${esp8266_4M1M.build_flags} ${beta_platform.build_flags} -DPLUGIN_BUILD_CUSTOM
lib_ignore = ESP32_ping, ESP32WebServer
extra_scripts = pre:pre_extra_script.py
; Custom: 4096k version --------------------------
[env:custom_ESP32_1M8_partition]
platform = ${core_esp32.platform}
build_unflags = ${core_esp32.build_unflags}
build_flags = ${core_esp32.build_flags} -DPLUGIN_BUILD_CUSTOM
lib_deps = ${core_esp32.lib_deps}
lib_ignore = ${core_esp32.lib_ignore}
board = esp32dev
board_build.partitions = esp32_partition_app1810k_spiffs316k.csv
board_build.f_flash = 80000000L
board_build.flash_mode = dout
board_upload.maximum_size = 1900544
extra_scripts = pre:pre_custom_esp32.py
[env:esp32test_1M8_partition]
platform = ${core_esp32.platform}
build_unflags = ${core_esp32.build_unflags}
build_flags = ${core_esp32.build_flags} -DPLUGIN_SET_TEST_ESP32
lib_deps = ${core_esp32.lib_deps}
lib_ignore = ${core_esp32.lib_ignore}
board = esp32dev
board_build.partitions = esp32_partition_app1810k_spiffs316k.csv
board_build.f_flash = 80000000L
board_build.flash_mode = dout
board_upload.maximum_size = 1900544
; Special env for memory analysis
; This may generate builds which cannot be run, so do not upload to a node.
+40
View File
@@ -0,0 +1,40 @@
Import("env")
import os
# access to global construction environment
#print env
# Dump construction environment (for debug purpose)
#print env.Dump()
# append extra flags to global build environment
# which later will be used to build:
# - project source code
# - frameworks
# - dependent libraries
env.Append(CPPDEFINES=[
("WEBSERVER_RULES_DEBUG", "0")
])
if os.path.isfile('src/Custom.h'):
env['CPPDEFINES'].append("USE_CUSTOM_H")
else:
env['CPPDEFINES'].extend([
"CONTROLLER_SET_ALL",
"NOTIFIER_SET_NONE",
"PLUGIN_SET_ONLY_SWITCH",
"USES_P001", # Switch
"USES_P002", # ADC
"USES_P004", # Dallas DS18b20
"USES_P028", # BME280
"USES_P036", # FrameOLED
"USES_P049", # MHZ19
"USES_P052", # SenseAir
"USES_P056", # SDS011-Dust
"USES_P059", # Encoder
"USES_P082", # GPS
"USES_P087", # Serial Proxy
"USE_SETTINGS_ARCHIVE"
])
print(env['CPPDEFINES'])
+1 -1
View File
@@ -36,7 +36,7 @@ else:
"USES_P085", # AcuDC24x
"USES_P087", # Serial Proxy
"USES_C018"
"USE_SETTINGS_ARCHIVE"
])
print(env['CPPDEFINES'])
+5 -3
View File
@@ -45,7 +45,8 @@ To create/register a plugin, you have to :
\******************************************************************************/
#if defined(CORE_POST_2_5_0) && !defined(MEMORY_ANALYSIS) && !defined(USE_CUSTOM_H)
#ifndef USE_SETTINGS_ARCHIVE
#define USE_SETTINGS_ARCHIVE
// FIXME TD-er: Disabled for now, to reduce binary size
// #define USE_SETTINGS_ARCHIVE
#endif // USE_SETTINGS_ARCHIVE
#endif
@@ -581,8 +582,9 @@ To create/register a plugin, you have to :
#define USES_P039 // Environment - Thermocouple
#define USES_P040 // RFID - ID12LA/RDM6300
#define USES_P041 // NeoClock
#define USES_P042 // Candle
// FIXME TD-er: Disabled NeoClock and Candle plugin to make builds fit in max bin size.
// #define USES_P041 // NeoClock
// #define USES_P042 // Candle
#define USES_P043 // ClkOutput
#define USES_P044 // P1WifiGateway