Skip to content

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

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

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.

Summary by CodeRabbit

  • Performance
    • Reduced memory usage on screens smaller than 480 pixels by disabling the large 48-point font.
  • UI Improvements
    • Added a fallback font for the shutdown countdown when the larger font is unavailable.
    • Preserved the larger countdown font on supported screen sizes.

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.
@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: 8f6a3beb-2ce9-4324-9a8c-1c3b81c8e61b

📥 Commits

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

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

📝 Walkthrough

Walkthrough

The 48-point Montserrat font is now limited to screens at least 480 pixels wide. The shutdown countdown label selects that font when available and otherwise uses the 20-point fallback font.

Changes

Conditional font configuration

Layer / File(s) Summary
Font availability and label selection
include/lv_conf.h, src/ui/ui.cpp
LV_FONT_MONTSERRAT_48 is enabled only when WLED_SCREEN_WIDTH >= 480. The shutdown countdown label uses the 20-point font when the 48-point font is unavailable.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to d7b0b

The change removes an unused large font from small-screen builds while preserving the larger countdown font on supported displays; the reported builds pass and no actionable merge-blocking risk remains beyond normal checks and review.

Possibly related PRs

Suggested reviewers: figamore

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: fixing flash overflow in the affected build.
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.
✨ 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.

@booherbg

Copy link
Copy Markdown
Author

Found this while testing an unrelated power button issue - feel free to delete if not helpful.

@booherbg

Copy link
Copy Markdown
Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 15, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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