From 4cb676a7a7fb1f1db9cdc61d920667698ad56c9d Mon Sep 17 00:00:00 2001 From: cjkas Date: Tue, 13 Oct 2026 20:27:49 +0200 Subject: [PATCH] build: limit inlining in every file of the debug build At -Og GCC only caps inlining growth in units over large-unit-insns (10000 instructions). Smaller files inline ArduinoJson's helpers into every caller: moving the JSON parsing out of Somfy.cpp grew the image by 19 KB, past the 1.5 MB app partition. Treating every file as large keeps inlining at the level the big files already had and frees 13 KB. Co-Authored-By: Claude Opus 5.5 --- platformio.ini | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index e422212..b8c2ee3 100644 --- a/platformio.ini +++ b/platformio.ini @@ -64,7 +64,12 @@ extends = esp32 board = esp32dev build_type = debug board_build.partitions = esp32_3MB.csv -build_flags = ${dualcore.build_flags} +; -Og only limits inlining in units over large-unit-insns (10000 by default). +; Smaller files inline ArduinoJson's helpers into every caller, which costs +; KBs of flash per file, so treat every file as large. +build_flags = + ${dualcore.build_flags} + --param=large-unit-insns=1000 [env:esp32c3] extends = esp32