Port display_gif_sd and display_speed_wifi to LVGL 9.6 + shared library
- both use shared/jc3636w518.ini, board library and perf monitor - GIF decoded in the display color format, loop delay 1 ms, per-loop memory prints removed - lv_conf: LVGL drive A: = SD card via LV_USE_FS_STDIO (/sdcard/) - shared/README.md, CLAUDE.md and project README updated Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
6e7206b821
commit
55e27b6572
15 files changed
+125
-2488
No files matched your search
@@ -0,0 +1,60 @@
|
||||
# Shared JC3636W518 code
|
||||
|
||||
Everything every JC3636W518 project needs, in one place:
|
||||
|
||||
| Path | What |
|
||||
|---|---|
|
||||
| `jc3636w518.ini` | Common PlatformIO settings: pioarduino 51.03.05 (Arduino core 3.0.5), ESP32-S3 16 MB QIO / OPI PSRAM, `huge_app.csv`, `-O2`, LVGL 9.6.0, vendor display libraries, COM21 |
|
||||
| `include/lv_conf.h` | LVGL 9.6 config (generated from the 9.6 template; every change is marked `JC3636W518`) |
|
||||
| `include/lv_attr_jc3636w518.h` | LVGL attribute overrides: hot functions and `lv_display_flush_ready()` in IRAM |
|
||||
| `lib/JC3636W518/` | Board library: `jc3636w518.h` (display/touch/backlight init + LVGL glue), `pincfg.h` (pin map), `perf_monitor.h` (FPS/CPU monitor) |
|
||||
|
||||
## New project
|
||||
```ini
|
||||
; platformio.ini
|
||||
[platformio]
|
||||
extra_configs = ../shared/jc3636w518.ini ; path to this folder
|
||||
|
||||
[shared]
|
||||
dir = ../shared ; same path
|
||||
|
||||
[env:jc3636w518]
|
||||
extends = jc3636w518
|
||||
; project-specific overrides, e.g. board_build.partitions = default_16MB.csv
|
||||
```
|
||||
```cpp
|
||||
#include <Arduino.h>
|
||||
#include "jc3636w518.h"
|
||||
#include "perf_monitor.h" // optional
|
||||
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
lv_display_t *disp = scr_lvgl_init(); // also does lv_init()
|
||||
perf_monitor_begin(disp); // optional
|
||||
// ... create LVGL UI ...
|
||||
}
|
||||
|
||||
void loop() {
|
||||
perf_timer_handler(); // or lv_timer_handler()
|
||||
vTaskDelay(1);
|
||||
perf_monitor_print(); // optional: FPS / refresh / other / CPU once per second
|
||||
}
|
||||
```
|
||||
Add `-DJC_DRAW_BUF_ROWS=<n>` to `build_flags` (as `${jc3636w518.build_flags}` + extra line) to change the draw buffer height (default 72).
|
||||
|
||||
## Performance settings (measured with `display_gif_embedded`, 360×360 GIF at 23.7 fps)
|
||||
| Setting | Effect |
|
||||
|---|---|
|
||||
| LVGL 9.6 (AnimatedGIF decoder) | GIF decode 24 → 12 ms per frame vs LVGL 8.3 |
|
||||
| Two 72-row draw buffers in internal RAM | render while the previous chunk is sent (120 rows: no gain) |
|
||||
| `LV_COLOR_FORMAT_DEFAULT = RGB565_SWAPPED` | renders in the ST77916 byte order → no swap pass in flush |
|
||||
| QSPI 80 MHz (was 50) | faster transfer to the panel |
|
||||
| `-O2`, IRAM for hot LVGL functions | faster rendering/decoding |
|
||||
| GIF in display color format (`lv_gif_set_color_format`) | per sketch, only when the GIF needs no transparency (plain background) |
|
||||
|
||||
Result: CPU for the GIF 86 % → 53 % at full frame rate.
|
||||
|
||||
## Display / LVGL facts
|
||||
- Display format is `RGB565_SWAPPED`. For images/canvases you create yourself, use `lv_display_get_color_format(disp)` or ARGB8888 when transparency is needed.
|
||||
- LVGL drive `A:` = SD card (`LV_USE_FS_STDIO`, path `/sdcard/`); mount the card with `SD_MMC` first.
|
||||
- `LV_USE_STDLIB_MALLOC = CLIB`: LVGL uses `malloc`, so large allocations land in PSRAM. `lv_mem_monitor()` reports 0 in this mode.
|
||||
@@ -1957,14 +1957,14 @@
|
||||
#define LV_FS_DEFAULT_DRIVER_LETTER 0
|
||||
|
||||
/** stdio */
|
||||
#define LV_USE_FS_STDIO 0
|
||||
#define LV_USE_FS_STDIO 1 /* JC3636W518: 'A:' = SD card (SD_MMC mount /sdcard) */
|
||||
|
||||
#if LV_USE_FS_STDIO
|
||||
/** Drive letter for stdio (65 = 'A', 0 = disabled) */
|
||||
#define LV_FS_STDIO_LETTER 0
|
||||
#define LV_FS_STDIO_LETTER 'A'
|
||||
|
||||
/** Working directory for stdio */
|
||||
#define LV_FS_STDIO_PATH ""
|
||||
#define LV_FS_STDIO_PATH "/sdcard/"
|
||||
|
||||
/** Read cache size in bytes for stdio (0 = disabled) */
|
||||
#define LV_FS_STDIO_CACHE_SIZE 0
|
||||
|
||||
Reference in new issue
Block a user