Skip to content

Fix flash overflow in esp32-cyd-capacitive-ip5306-shutdown build - #1

Closed
booherbg wants to merge 1 commit into
figamore:mainfrom
booherbg:fix-ip5306-env-flash-overflow
Closed

booherbg wants to merge 1 commit into
figamore:mainfrom
booherbg:fix-ip5306-env-flash-overflow

Conversation

@booherbg

@booherbg booherbg commented Aug 14, 2026

Copy link
Copy Markdown

pio run -e esp32-cyd-capacitive-ip5306-shutdown fails on current main:

Flash: [==========]  102.4% (used 1811173 bytes from 1769472 bytes)
Error: The program size (1811173 bytes) is greater than maximum allowed (1769472 bytes)

The shutdown countdown label is the only reference to lv_font_montserrat_48, which costs ~97KB of flash in this env alone. Build history of the env:

tag app slot usage
v1.2.0 96.7%
v1.2.1 96.9%
v1.2.2 102.3% — first failure
v1.2.3 102.4%

v1.2.2 grew the app by ~96KB, which consumed the env's remaining headroom. CI only builds esp32-cyd, so the breakage was not visible there.

Fix: gate LV_FONT_MONTSERRAT_48 behind WLED_SCREEN_WIDTH >= 480 (same pattern already used for montserrat_24/28) and fall back to lv_font_montserrat_20 for the countdown on small screens.

Verified locally:

  • esp32-cyd-capacitive-ip5306-shutdown: 102.4% → 96.9%
  • esp32-cyd: unchanged size (1713705 bytes before and after; the font was already discarded by the linker as unreferenced in this env)
  • jc8048w550c, jc4880p443, macos sim: build, big screens keep the 48px countdown font

Might be worth adding this env to the release workflow's build matrix so it can't regress silently again.

@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e08356ef-4113-4c41-892a-ee252a9b9533

📥 Commits

Reviewing files that changed from the base of the PR and between e56eaf4 and 3e887b7.

📒 Files selected for processing (2)
  • include/lv_conf.h
  • src/ui/ui.cpp

📝 Walkthrough

Walkthrough

The configuration now enables LV_FONT_MONTSERRAT_48 only on screens at least 480 pixels wide. The shutdown countdown uses the 48-point font when available and otherwise uses lv_font_montserrat_20.

Changes

Font selection

Layer / File(s) Summary
Conditional font fallback
include/lv_conf.h, src/ui/ui.cpp
LV_FONT_MONTSERRAT_48 is disabled below 480 pixels to reduce firmware size. The shutdown countdown selects the 20-point fallback when the 48-point font is unavailable.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 3e887

This change removes an unnecessary large font from the affected small-screen build while preserving the larger font where needed; no actionable merge-blocking risk remains beyond normal checks and review.

Suggested reviewers: figamore

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the primary change: fixing flash overflow in the affected build.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

The shutdown countdown is the only user of lv_font_montserrat_48, which
adds ~97KB to that env. The env last built at v1.2.1 (96.9% of the
1.69MiB OTA slot); the app growth in v1.2.2 pushed it to 102.3% and it
has failed to build since. CI only compiles esp32-cyd, so the breakage
went unnoticed.

Gate the 48px font behind WLED_SCREEN_WIDTH >= 480 like montserrat_24/28
and fall back to montserrat_20 for the countdown on small screens.

esp32-cyd-capacitive-ip5306-shutdown: 102.4% -> 96.9% of app slot;
esp32-cyd unchanged in size; jc8048w550c/jc4880p443/macos still build
and keep the 48px font where enabled.
@booherbg
booherbg force-pushed the fix-ip5306-env-flash-overflow branch from 3e887b7 to d7b0b26 Compare August 14, 2026 20:43
@booherbg booherbg closed this Aug 14, 2026
@booherbg

Copy link
Copy Markdown
Author

Superseded by #2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant