build(solo-dual): optimise for size (-Os), not -Ofast

The nRF52 Arduino core compiles with -Ofast (≈ -O3 + -ffast-math) by
default, which had pushed this feature-rich solo build to ~90% flash.
Unflag -Ofast and build with -Os: flash drops 90.1% → 60.9% (638 KB →
431 KB, ~200 KB reclaimed) with no loss of functionality and a negligible
speed cost for a UI/mesh workload. -Os also avoids fast-math float
reassociation, so it's marginally safer for the geo/distance maths.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
MarekZegare4
2026-06-22 14:43:33 +02:00
parent f49b7dd8bd
commit 44ae27454d

View File

@@ -152,9 +152,15 @@ extra_scripts = post:create-uf2.py
[env:WioTrackerL1_companion_solo_dual]
extends = WioTrackerL1CompanionDual
; Optimise for size, not speed: the nRF52 Arduino core defaults to -Ofast
; (≈ -O3 + -ffast-math), which bloats flash by ~200 KB on this feature-rich
; solo build. -Os keeps every feature, fits comfortably, and is actually safer
; for float (no fast-math reassociation). Speed is irrelevant for the UI/mesh.
build_unflags = -Ofast
build_flags = ${WioTrackerL1CompanionDual.build_flags}
-D UI_HAS_JOYSTICK_UPDOWN=1
-D ENABLE_SCREENSHOT
-Os
extra_scripts = post:create-uf2.py
[env:WioTrackerL1_companion_dual_dev]