squeezing a few KB out of builds that are close to 100% flash usage

This commit is contained in:
Frank
2024-05-04 01:44:14 +02:00
parent 70a5d8b843
commit fc66dcc0ce
3 changed files with 26 additions and 20 deletions

View File

@@ -1067,6 +1067,7 @@ lib_deps_V4_M =
${common_mm.animartrix_lib_deps} ${common_mm.animartrix_lib_deps}
build_flags_XL = build_flags_XL =
-D WLEDMM_SAVE_FLASH
-D USERMOD_WEATHER ; WLEDMM usermod -D USERMOD_WEATHER ; WLEDMM usermod
-D USERMOD_MPU6050_IMU ; gyro/accelero for USERMOD_GAMES (ONLY WORKS IF USERMOD_FOUR_LINE_DISPLAY NOT INCLUDED - I2C SHARING BUG) -D USERMOD_MPU6050_IMU ; gyro/accelero for USERMOD_GAMES (ONLY WORKS IF USERMOD_FOUR_LINE_DISPLAY NOT INCLUDED - I2C SHARING BUG)
-D USERMOD_GAMES ; WLEDMM usermod -D USERMOD_GAMES ; WLEDMM usermod
@@ -1238,6 +1239,7 @@ build_flags = ${esp32_4MB_S_base.build_flags}
-D WLED_DISABLE_LOXONE -D WLED_DISABLE_LOXONE
;-D WLED_DISABLE_MQTT ;-D WLED_DISABLE_MQTT
;-D WLED_DISABLE_INFRARED ;-D WLED_DISABLE_INFRARED
-D WLEDMM_SAVE_FLASH
;WLEDMM: disable the next two lines if you don't need "net Debug". It will free ~2% of flash ;WLEDMM: disable the next two lines if you don't need "net Debug". It will free ~2% of flash
-D WLED_DEBUG_HOST='"192.168.x.x"' ;; to send debug messages over network to host 192.168.x.y - FQDN is also possible -D WLED_DEBUG_HOST='"192.168.x.x"' ;; to send debug messages over network to host 192.168.x.y - FQDN is also possible
-D WLED_DEBUG_PORT=1768 ;; port for network debugging. default = 7868 -D WLED_DEBUG_PORT=1768 ;; port for network debugging. default = 7868
@@ -1245,15 +1247,15 @@ build_flags = ${esp32_4MB_S_base.build_flags}
; RAM: [=== ] 25.0% (used 81988 bytes from 327680 bytes) ; RAM: [=== ] 25.0% (used 81988 bytes from 327680 bytes)
; Flash: [========= ] 87.4% (used 1374677 bytes from 1572864 bytes) WLEDMM: Earlier 85.7 ; Flash: [========= ] 87.4% (used 1374677 bytes from 1572864 bytes) WLEDMM: Earlier 85.7
;; optimized-for-speed build ;; optimized-for-speed build
; RAM: [=== ] 25.8% (used 84628 bytes from 327680 bytes) ; RAM: [=== ] 25.4% (used 83244 bytes from 327680 bytes)
; Flash: [==========] 99.4% (used 1562869 bytes from 1572864 bytes) ; Flash: [========= ] 93.3% (used 1466821 bytes from 1572864 bytes)
[env:esp32_4MB_M] [env:esp32_4MB_M]
extends = esp32_4MB_M_base extends = esp32_4MB_M_base
build_flags = ${esp32_4MB_M_base.build_flags} build_flags = ${esp32_4MB_M_base.build_flags}
-D WLED_RELEASE_NAME=esp32_4MB_M -D WLED_RELEASE_NAME=esp32_4MB_M
; RAM: [=== ] 25.2% (used 82628 bytes from 327680 bytes) ; RAM: [=== ] 26.0% (used 85244 bytes from 327680 bytes)
; Flash: [========= ] 94.3% (used 1483793 bytes from 1572864 bytes) WLEDMM: earlier 91.1 ; Flash: [==========] 97.4% (used 1532125 bytes from 1572864 bytes)
[env:esp32_4MB_M_eth] [env:esp32_4MB_M_eth]
extends = esp32_4MB_M_base extends = esp32_4MB_M_base
@@ -1276,8 +1278,8 @@ build_flags = ${esp32_4MB_XL_base.build_flags}
-D WLEDMM_SAVE_FLASH ;; a humble attempt to save a few extra bytes -D WLEDMM_SAVE_FLASH ;; a humble attempt to save a few extra bytes
build_unflags = ${esp32_4MB_XL_base.build_unflags} build_unflags = ${esp32_4MB_XL_base.build_unflags}
board_build.partitions = tools/WLED_ESP32_4MB_256KB_FS.csv board_build.partitions = tools/WLED_ESP32_4MB_256KB_FS.csv
; RAM: [=== ] 26.3% (used 86172 bytes from 327680 bytes) ; RAM: [=== ] 26.3% (used 86188 bytes from 327680 bytes)
; Flash: [========= ] 85.0% (used 1615569 bytes from 1900544 bytes) ; Flash: [========= ] 85.2% (used 1619513 bytes from 1900544 bytes)
;; standard framework build for 16MB flash, optimized for speed ;; standard framework build for 16MB flash, optimized for speed
[env:esp32_16MB_S] [env:esp32_16MB_S]
@@ -1310,8 +1312,8 @@ build_flags = ${esp32_4MB_M_base.build_flags}
board = esp32_16MB board = esp32_16MB
board_build.partitions = tools/WLED_ESP32_16MB.csv ;; WLED standard for 16MB flash: 2MB firmware, 12 MB filesystem board_build.partitions = tools/WLED_ESP32_16MB.csv ;; WLED standard for 16MB flash: 2MB firmware, 12 MB filesystem
;board_build.partitions = tools/WLED_ESP32_16MB_9MB_FS.csv ;; WLED extended for 16MB flash: 3.2MB firmware, 9 MB filesystem ;board_build.partitions = tools/WLED_ESP32_16MB_9MB_FS.csv ;; WLED extended for 16MB flash: 3.2MB firmware, 9 MB filesystem
; RAM: [== ] 24.4% (used 79916 bytes from 327680 bytes) ; RAM: [=== ] 26.0% (used 85244 bytes from 327680 bytes)
; Flash: [======= ] 67.0% (used 1405701 bytes from 2097152 bytes) ; Flash: [======= ] 73.1% (used 1532125 bytes from 2097152 bytes)
;lib_ignore = IRremoteESP8266 ; use with WLED_DISABLE_INFRARED for faster compilation ;lib_ignore = IRremoteESP8266 ; use with WLED_DISABLE_INFRARED for faster compilation
[env:esp32_4MB_M_debug] [env:esp32_4MB_M_debug]
@@ -1364,8 +1366,8 @@ build_flags = ${esp32_4MB_M_base.build_flags}
-D WLED_RELEASE_NAME=esp32_16MB_M_eth ; This will be included in the firmware.bin filename -D WLED_RELEASE_NAME=esp32_16MB_M_eth ; This will be included in the firmware.bin filename
-D WLED_USE_ETHERNET -D WLED_USE_ETHERNET
-D WLED_DISABLE_ESPNOW ;; ESP-NOW requires wifi, may crash with ethernet only -D WLED_DISABLE_ESPNOW ;; ESP-NOW requires wifi, may crash with ethernet only
; RAM: [== ] 24.5% (used 80348 bytes from 327680 bytes) ; RAM: [=== ] 26.1% (used 85452 bytes from 327680 bytes)
; Flash: [======= ] 69.4% (used 1455233 bytes from 2097152 bytes) ; Flash: [======= ] 73.3% (used 1537945 bytes from 2097152 bytes)
[env:esp8266_2MB_S] [env:esp8266_2MB_S]
@@ -1608,7 +1610,7 @@ build_unflags = ${esp32_4MB_V4_M_base.build_unflags}
-D WLED_ENABLE_HUB75MATRIX -D WLED_ENABLE_HUB75MATRIX
;; RAM: [=== ] 28.0% (used 91664 bytes from 327680 bytes) ;; RAM: [=== ] 28.0% (used 91664 bytes from 327680 bytes)
;; Flash: [==========] 99.9% (used 1572053 bytes from 1572864 bytes) ;; Flash: [==========] 99.5% (used 1564945 bytes from 1572864 bytes)
;; V4 build for 16MB flash, optimized for speed ;; V4 build for 16MB flash, optimized for speed
[env:esp32_16MB_V4_S] [env:esp32_16MB_V4_S]
@@ -1965,14 +1967,15 @@ build_flags = ${common.build_flags} ${esp32s3.build_flags} -Wno-misleading-inden
-D WLED_DISABLE_INFRARED ; RAM 136 bytes; FLASH 24492 bytes - disabled to stay below 100% -D WLED_DISABLE_INFRARED ; RAM 136 bytes; FLASH 24492 bytes - disabled to stay below 100%
;; -D WLED_DISABLE_ALEXA ; RAM 116 bytes; FLASH 13524 bytes ;; -D WLED_DISABLE_ALEXA ; RAM 116 bytes; FLASH 13524 bytes
;; -D WLED_DISABLE_MQTT ; RAM 216 bytes; FLASH 16496 bytes ;; -D WLED_DISABLE_MQTT ; RAM 216 bytes; FLASH 16496 bytes
-D WLEDMM_SAVE_FLASH
; -D WLED_DEBUG ; -D WLED_DEBUG
; -D SR_DEBUG ; -D SR_DEBUG
; -D MIC_LOGGER ; -D MIC_LOGGER
lib_deps = ${esp32s3.lib_deps} ${common_mm.lib_deps_S} ${common_mm.lib_deps_V4_M} lib_deps = ${esp32s3.lib_deps} ${common_mm.lib_deps_S} ${common_mm.lib_deps_V4_M}
lib_ignore = lib_ignore =
IRremoteESP8266 ; use with WLED_DISABLE_INFRARED for faster compilation IRremoteESP8266 ; use with WLED_DISABLE_INFRARED for faster compilation
; RAM: [== ] 20.6% (used 67524 bytes from 327680 bytes) ; RAM: [== ] 20.6% (used 67532 bytes from 327680 bytes)
; Flash: [==========] 98.5% (used 1549341 bytes from 1572864 bytes) ; Flash: [==========] 98.4% (used 1547445 bytes from 1572864 bytes)
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
@@ -2017,6 +2020,7 @@ build_flags = ${common.build_flags} ${esp32s2.build_flags}
-D WLED_DISABLE_ALEXA ;; RAM 116 bytes; FLASH 13524 bytes -D WLED_DISABLE_ALEXA ;; RAM 116 bytes; FLASH 13524 bytes
; -D WLED_DISABLE_MQTT ;; RAM 216 bytes; FLASH 16496 bytes ; -D WLED_DISABLE_MQTT ;; RAM 216 bytes; FLASH 16496 bytes
-D WLED_DISABLE_INFRARED ;; RAM 136 bytes; FLASH 24492 bytes -D WLED_DISABLE_INFRARED ;; RAM 136 bytes; FLASH 24492 bytes
-D WLEDMM_SAVE_FLASH
-D LEDPIN=39 ;; onboard neopixel LED. Attach your own LEDs to GPIO 7 or GPIO 6 -D LEDPIN=39 ;; onboard neopixel LED. Attach your own LEDs to GPIO 7 or GPIO 6
-D BTNPIN=0 -D BTNPIN=0
;-D RLYPIN=6 ;-D RLYPIN=6
@@ -2035,7 +2039,7 @@ lib_ignore =
OneWire ; not needed as we don't include USERMOD_DALLASTEMPERATURE OneWire ; not needed as we don't include USERMOD_DALLASTEMPERATURE
monitor_filters = esp32_exception_decoder monitor_filters = esp32_exception_decoder
; RAM: [== ] 21.5% (used 70448 bytes from 327680 bytes) ; RAM: [== ] 21.5% (used 70448 bytes from 327680 bytes)
; Flash: [==========] 99.5% (used 1434054 bytes from 1441792 bytes) !!! 99% ; Flash: [==========] 99.4% (used 1432846 bytes from 1441792 bytes)
;; MM environment for generic ESP32-S2, with PSRAM, 4MB flash (300kB filesystem to have more program space) ;; MM environment for generic ESP32-S2, with PSRAM, 4MB flash (300kB filesystem to have more program space)
;; PINs assignments optimized for use with serg74 "mini shield" ;; PINs assignments optimized for use with serg74 "mini shield"
@@ -2070,6 +2074,7 @@ build_flags = ${common.build_flags} ${esp32s2.build_flags}
-D WLED_DISABLE_ALEXA ;; save flash space -D WLED_DISABLE_ALEXA ;; save flash space
-D WLED_DISABLE_HUESYNC ;; save flash space -D WLED_DISABLE_HUESYNC ;; save flash space
-D WLED_DISABLE_LOXONE ;; save flash space -D WLED_DISABLE_LOXONE ;; save flash space
-D WLEDMM_SAVE_FLASH
-D AUDIOPIN=-1 -D AUDIOPIN=-1
-D BTNPIN=-1 -D IRPIN=-1 -D BTNPIN=-1 -D IRPIN=-1
-D LEDPIN=16 ;; second led pin = 18 -D LEDPIN=16 ;; second led pin = 18
@@ -2085,8 +2090,8 @@ lib_ignore =
IRremoteESP8266 ; use with WLED_DISABLE_INFRARED for faster compilation IRremoteESP8266 ; use with WLED_DISABLE_INFRARED for faster compilation
OneWire ; not needed as we don't include USERMOD_DALLASTEMPERATURE OneWire ; not needed as we don't include USERMOD_DALLASTEMPERATURE
monitor_filters = esp32_exception_decoder monitor_filters = esp32_exception_decoder
; RAM: [=== ] 29.7% (used 97376 bytes from 327680 bytes) ; RAM: [== ] 21.8% (used 71304 bytes from 327680 bytes)
; Flash: [======== ] 81.4% (used 1547834 bytes from 1900544 bytes) ; Flash: [======== ] 84.0% (used 1596970 bytes from 1900544 bytes)
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
@@ -2131,6 +2136,7 @@ build_flags = ${common.build_flags} ${esp32c3.build_flags}
-D WLEDMM_WIFI_POWERON_HACK -DLOLIN_WIFI_FIX ;; use this _only_ if your device is not able to make a WiFI connection! -D WLEDMM_WIFI_POWERON_HACK -DLOLIN_WIFI_FIX ;; use this _only_ if your device is not able to make a WiFI connection!
;-D WLED_DISABLE_INFRARED ;; save flash space ;-D WLED_DISABLE_INFRARED ;; save flash space
;-D WLED_DISABLE_ALEXA ;; save flash space ;-D WLED_DISABLE_ALEXA ;; save flash space
-D WLEDMM_SAVE_FLASH
-D LEDPIN=8 ;; onboard neopixel 5x5 Matrix. Attach your own LEDs to GPIO 20 -D LEDPIN=8 ;; onboard neopixel 5x5 Matrix. Attach your own LEDs to GPIO 20
-D BTNPIN=9 -D BTNPIN=9
; -D STATUSLED=10 ;; onboard LED ; -D STATUSLED=10 ;; onboard LED
@@ -2145,7 +2151,7 @@ lib_ignore =
OneWire ; not needed as we don't include USERMOD_DALLASTEMPERATURE OneWire ; not needed as we don't include USERMOD_DALLASTEMPERATURE
U8g2 ; not needed as we don't include USERMOD_FOUR_LINE_DISPLAY U8g2 ; not needed as we don't include USERMOD_FOUR_LINE_DISPLAY
; RAM: [=== ] 25.9% (used 84884 bytes from 327680 bytes) ; RAM: [=== ] 25.9% (used 84884 bytes from 327680 bytes)
; Flash: [==========] 99.1% (used 1557952 bytes from 1572864 bytes) ; Flash: [==========] 98.9% (used 1555608 bytes from 1572864 bytes)
;; MM environment for ESP32-C3 "mini" and "super mini" -> flash mode "dio" instead of "qio" (see #101) ;; MM environment for ESP32-C3 "mini" and "super mini" -> flash mode "dio" instead of "qio" (see #101)
[env:esp32c3mini_dio_4MB_M] [env:esp32c3mini_dio_4MB_M]
@@ -2164,7 +2170,7 @@ build_flags = ${env:esp32c3dev_4MB_M.build_flags}
-D WLED_DISABLE_ADALIGHT ;; to disable serial protocols for boards with CDC USB (Serial RX will receive junk commands, unless its pulled down by resistor) -D WLED_DISABLE_ADALIGHT ;; to disable serial protocols for boards with CDC USB (Serial RX will receive junk commands, unless its pulled down by resistor)
-D HW_PIN_SDA=0 -D HW_PIN_SCL=1 ;; avoid pin conflicts -D HW_PIN_SDA=0 -D HW_PIN_SCL=1 ;; avoid pin conflicts
; RAM: [=== ] 25.8% (used 84700 bytes from 327680 bytes) ; RAM: [=== ] 25.8% (used 84700 bytes from 327680 bytes)
; Flash: [==========] 98.9% (used 1554906 bytes from 1572864 bytes) ; Flash: [==========] 98.7% (used 1552582 bytes from 1572864 bytes)
;; MM environment for "seeed xiao -C3" boards ;; MM environment for "seeed xiao -C3" boards
[env:seeed_esp32c3_4MB_S] [env:seeed_esp32c3_4MB_S]

View File

@@ -488,7 +488,7 @@ void FourLineDisplayUsermod::draw2x2String(uint8_t col, uint8_t row, const char
if (!typeOK || !enabled) return; if (!typeOK || !enabled) return;
if (u8x8 == nullptr) return; if (u8x8 == nullptr) return;
if (FLD_SemaphoreTake(drawMux, maxWait) != pdTRUE) return; // WLEDMM acquire draw mutex if (FLD_SemaphoreTake(drawMux, maxWait) != pdTRUE) return; // WLEDMM acquire draw mutex
#if defined(ARDUINO_ARCH_ESP32) && !defined(OLD_4LD_FONTS) // WLEDMM use nicer 2x2 font on ESP32 #if defined(ARDUINO_ARCH_ESP32) && !defined(OLD_4LD_FONTS) && !defined(WLEDMM_SAVE_FLASH) // WLEDMM use nicer 2x2 font on ESP32
if (lineHeight>1) { // WLEDMM use 2x3 on 128x64 displays if (lineHeight>1) { // WLEDMM use 2x3 on 128x64 displays
//u8x8->setFont(u8x8_font_profont29_2x3_r); // sans serif 2x3 //u8x8->setFont(u8x8_font_profont29_2x3_r); // sans serif 2x3
u8x8->setFont(u8x8_font_courB18_2x3_r); // courier bold 2x3 u8x8->setFont(u8x8_font_courB18_2x3_r); // courier bold 2x3

View File

@@ -230,7 +230,7 @@ void handleSerial()
if ((millis() - startTime) > SERIAL_MAXTIME_MILLIS) { USER_PRINTLN(F("handleSerial(): need a break after >100ms of activity.")); } if ((millis() - startTime) > SERIAL_MAXTIME_MILLIS) { USER_PRINTLN(F("handleSerial(): need a break after >100ms of activity.")); }
//#endif //#endif
#else #else
#pragma message "Serial protocols (AdaLight, Serial JSON, Serial LED driver) disabled" #pragma message "Serial protocols (AdaLight, Serial JSON, Serial LED driver, improv) disabled"
#endif #endif
// If Continuous Serial Streaming is enabled, send new LED data as bytes // If Continuous Serial Streaming is enabled, send new LED data as bytes