Optimize LVGL rendering performance, disable DMA, add PNG/BMP/GIF support#16
Merged
Merged
Conversation
✅ Deploy Preview for cydnote ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
…t swap - Extract TEXTAREA_SCROLL_ANIM_MS constant (was magic 260) - Refactor setReadChunkText to accept nav state (has_prev, has_next) and perform text swap + scroll positioning atomically - Temporarily set anim_duration=0 before lv_textarea_set_text() to prevent LVGL internal auto-scroll animation from conflicting with the explicit scroll target - Simplify loadReadChunkAtIndex: compute nav state locally and pass to editor in a single call, removing separate setReadChunkNavigationState Co-authored-by: shiftz300 <130174875+shiftz300@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Refactor editpr chunking logic to improve page scrolling
Fix editor chunk scroll jump by suppressing LVGL auto-scroll animation during text swap
Mar 14, 2026
- Disable unused SW color format renderers (RGB565A8, XRGB8888, L8, AL88, I1) saving ~28KB flash; keep RGB565/RGB888/ARGB8888/A8 - Enable LV_OBJ_STYLE_CACHE for faster style property lookups (+8B/widget) - Increase LV_DRAW_SW_CIRCLE_CACHE_SIZE 4→8 for rounded-corner perf - Enable LV_CACHE_DEF_SIZE=32KB for JPEG image decode caching - Enable LV_IMAGE_HEADER_CACHE_DEF_CNT=8 for image header caching - Disable LV_THEME_DEFAULT_GROW to reduce press animation redraws Co-authored-by: shiftz300 <130174875+shiftz300@users.noreply.github.com>
Copilot
AI
changed the title
Fix editor chunk scroll jump by suppressing LVGL auto-scroll animation during text swap
Optimize LVGL performance for ESP32-2432S028R hardware
Mar 14, 2026
Co-authored-by: shiftz300 <130174875+shiftz300@users.noreply.github.com>
- Comment out ESP32_DMA define — causes screen corruption on this CYD - Revert pushPixelsDMA() to pushColors() in flush callback - Enable LV_USE_LODEPNG=1 for PNG image support - Enable LV_USE_BMP=1 for BMP image support - Enable LV_USE_GIF=1 for GIF image support - Update isImageFile() to recognize .png, .bmp, .gif extensions Co-authored-by: shiftz300 <130174875+shiftz300@users.noreply.github.com>
Copilot
AI
changed the title
Optimize LVGL performance for ESP32-2432S028R hardware
Optimize LVGL rendering performance, disable DMA, add PNG/BMP/GIF support
Mar 14, 2026
There was a problem hiding this comment.
Pull request overview
This PR optimizes LVGL rendering performance on the ESP32-2432S028R board and adds support for additional image formats. It trades firmware size for speed, which is explicitly acceptable for this hardware target.
Changes:
- Performance tuning: switches to
-O2, doubles draw buffer size, increases SPI to 80 MHz, enables shadow/circle/style caches, and increases layer and image cache sizes - Disables DMA (causes screen corruption on this CYD board) and enables PNG, BMP, and GIF image decoders
- Refactors
setReadChunkText()to atomically set navigation state and suppress LVGL scroll animations during content swap, fixing the visible "scroll-up jump" on chunk switches
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| platformio.ini | Switch from -Os to -O2 and reduce LVGL_DRAW_BUF_DIV from 4 to 2 |
| src/lv_conf.h | Increase cache sizes, enable style cache, disable grow-on-press, enable LODEPNG/BMP/GIF decoders |
| src/Setup_ESP32_2432S028R_ILI9341.h | Increase SPI to 80 MHz, disable ESP32_DMA |
| src/app.h | Extend isImageFile() for png/bmp/gif; pass nav state into setReadChunkText() |
| src/ui/editor.h | Extract TEXTAREA_SCROLL_ANIM_MS constant; refactor setReadChunkText() to suppress scroll animation and batch nav state |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Maximize UI fluidity on ESP32-2432S028R hardware (user explicitly does not care about firmware size). Also disables DMA (causes screen corruption on this CYD) and enables additional image format decoders for the viewer.
Rendering performance
-Os→-O2: Speed-optimized codegen for rendering hot pathsLVGL_DRAW_BUF_DIV4→2: Half-screen draw buffer reduces flush calls per frameDMA fix
ESP32_DMA— causes screen corruption on this boardpushColors()(blocking SPI, no DMA)Image format support
LV_USE_LODEPNG,LV_USE_BMP,LV_USE_GIFdecodersisImageFile()to recognize.png,.bmp,.gif:Viewer now supports JPEG, PNG, BMP, GIF via LVGL's built-in decoders and the existing
D:filesystem driver.Build impact
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.