Rdzleo 0bdf7be875 feat: 应援灯防撕裂优化 - DMA直接填充GRAM + LVGL flush拦截 + PWM黑屏遮蔽
应援灯颜色切换从 LVGL 渲染改为直接 DMA 填充 GRAM,彻底消除 LVGL 刷新竞争:

lcd.c/lcd.h:
- 新增 lcd_fill_color_with_buf() 直接 DMA 分条填充全屏纯色
- 新增 TEON(0x35) 启用 TE 内部同步信号
- 新增 lcd_read_scanline()/lcd_wait_vsync_timeout() VSYNC 读取接口
  (实测 QSPI 模式下 TESLRD 始终返回 0xFFFF,软件 VSYNC 不可用)

ui_ScreenSet.c:
- LVGL flush 回调拦截:进入应援灯时替换为空操作,退出时恢复
  解决 LVGL 周期刷新覆盖 DMA 颜色导致红色方块残留的问题
- DMA 缓冲区生命周期管理:进入时分配,退出时释放
- 颜色切换 PWM=0 黑屏遮蔽:DMA 期间完全熄灭背光,撕裂不可见
- 滑块交互优化:拖动期间锁定其他按钮 + PWM 50ms 节流
- 手动滑动检测替代 LVGL 手势(layer_top 上手势不可靠)

.gitignore: 排除 docs/*.pdf 文档文件

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-30 15:18:41 +08:00

35 lines
1.1 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef _DZBJ_LCD_H_
#define _DZBJ_LCD_H_
#include "dzbj_gpio.h"
#include "esp_lvgl_port.h"
#include "esp_lcd_st77916.h"
#include <driver/i2c_master.h>
void lcd_init(void);
void lvgl_lcd_init(void);
void lcd_clear_screen_black(void);
// 直接 DMA 填充全屏纯色(绕过 LVGL约 26ms
// buf: 调用者预分配的 DMA 缓冲区,大小 >= LCD_WID * strip_h * 2 字节
// buf 中的数据必须已填充好目标颜色的 RGB565 值
// strip_h: 每条带高度(推荐 40
void lcd_fill_color_with_buf(uint16_t *buf, int strip_h);
// VSYNC 同步(防撕裂)
// 读取当前 LCD 扫描行号,成功返回 ESP_OK
esp_err_t lcd_read_scanline(uint16_t *scanline);
// 等待进入 VBLANK 消隐期timeout_us 建议 170001帧
// 返回 true=成功等到 VBLANKfalse=超时或读取失败
bool lcd_wait_vsync_timeout(uint32_t timeout_us);
// I2C 总线共享:传入主项目的 I2C 总线句柄,供触摸控制器使用
void lcd_set_i2c_bus(i2c_master_bus_handle_t bus);
#if DZBJ_ENABLE_TOUCH
void touch_init(void);
void get_touch(uint16_t* touchx, uint16_t* touchy);
#endif
#endif // _DZBJ_LCD_H_