Skip to content

Port upstream rendering optimizations and MemAvailable fix#4

Merged
cafedomingo merged 2 commits into
mainfrom
port-upstream-fixes
Feb 23, 2026
Merged

Port upstream rendering optimizations and MemAvailable fix#4
cafedomingo merged 2 commits into
mainfrom
port-upstream-fixes

Conversation

@cafedomingo

Copy link
Copy Markdown
Owner

Summary

  • Ports two useful but unmerged PRs from the upstream UCTRONICS repo
  • Rendering optimization (from UCTRONICS/SKU_RM0004#27 by @slyglif): buffer character pixels and use burst I2C transfer instead of pixel-by-pixel writes, remove redundant SYNC, fix off-by-one clipping in lcd_fill_rectangle, fix wrong dimension calc in lcd_draw_image
  • MemAvailable fix (from UCTRONICS/SKU_RM0004#17 by @mobejm): use MemAvailable instead of MemFree for RAM reporting — includes reclaimable cache/buffers for accurate available memory

Test plan

  • make clean && make builds without warnings
  • Display renders correctly (text, bars, badges)
  • RAM % reflects MemAvailable (should decrease vs previous MemFree-based value)

🤖 Generated with Claude Code

Buffer character pixels in memory and use burst I2C transfer instead of
pushing one pixel at a time. Use a stack buffer (832 bytes max) instead
of malloc/free per character. Remove redundant SYNC_REG call from
lcd_write_string. Fix off-by-one clipping in lcd_fill_rectangle and
wrong dimension calculation in lcd_draw_image.

Adapted from UCTRONICS#27 with endianness fix (the original
PR stores native uint16_t values but i2c_burst_transfer expects
big-endian byte order) and stack buffer simplification.

Co-authored-by: slyglif <10196904+slyglif@users.noreply.github.com>
MemAvailable includes reclaimable cache and buffers, giving a more
accurate picture of actually available memory.

Adapted from UCTRONICS#17

Co-authored-by: mobejm <4407468+mobejm@users.noreply.github.com>
@cafedomingo
cafedomingo merged commit b3d4269 into main Feb 23, 2026
@cafedomingo
cafedomingo deleted the port-upstream-fixes branch February 23, 2026 23:27
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