mirror of
https://gitee.com/dlmu-cone/tronone-h7-scaffold
synced 2026-07-24 11:37:44 +08:00
feat: speed up PRTS LCD refresh
This commit is contained in:
@@ -7,11 +7,12 @@
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#define PRTS_LVGL_BUF_LINES 40U
|
||||
#define PRTS_LVGL_BUF_LINES 64U
|
||||
#define PRTS_DMA_BUFFER_ATTR __attribute__((section(".dma_buffer"), aligned(32)))
|
||||
|
||||
static lv_display_t *prts_display = NULL;
|
||||
static uint8_t prts_lvgl_buf[TFT_LCD_W * PRTS_LVGL_BUF_LINES * 2U] PRTS_DMA_BUFFER_ATTR;
|
||||
static volatile uint32_t prts_lvgl_frame_count = 0U;
|
||||
|
||||
static uint32_t prts_lvgl_tick_get(void)
|
||||
{
|
||||
@@ -30,6 +31,10 @@ static void prts_lvgl_flush(lv_display_t *disp, const lv_area_t *area, uint8_t *
|
||||
|
||||
if (area->x2 < 0 || area->y2 < 0 || area->x1 >= (int32_t) TFT_LCD_W || area->y1 >= (int32_t) TFT_LCD_H)
|
||||
{
|
||||
if (lv_display_flush_is_last(disp))
|
||||
{
|
||||
prts_lvgl_frame_count++;
|
||||
}
|
||||
lv_display_flush_ready(disp);
|
||||
return;
|
||||
}
|
||||
@@ -38,6 +43,10 @@ static void prts_lvgl_flush(lv_display_t *disp, const lv_area_t *area, uint8_t *
|
||||
area_height = lv_area_get_height(area);
|
||||
if (area_width <= 0 || area_height <= 0)
|
||||
{
|
||||
if (lv_display_flush_is_last(disp))
|
||||
{
|
||||
prts_lvgl_frame_count++;
|
||||
}
|
||||
lv_display_flush_ready(disp);
|
||||
return;
|
||||
}
|
||||
@@ -72,9 +81,18 @@ static void prts_lvgl_flush(lv_display_t *disp, const lv_area_t *area, uint8_t *
|
||||
}
|
||||
}
|
||||
|
||||
if (lv_display_flush_is_last(disp))
|
||||
{
|
||||
prts_lvgl_frame_count++;
|
||||
}
|
||||
lv_display_flush_ready(disp);
|
||||
}
|
||||
|
||||
uint32_t PRTS_LVGLPortGetFrameCount(void)
|
||||
{
|
||||
return prts_lvgl_frame_count;
|
||||
}
|
||||
|
||||
bool PRTS_LVGLPortInit(void)
|
||||
{
|
||||
if (prts_display != NULL)
|
||||
|
||||
@@ -2,12 +2,14 @@
|
||||
#define PRTS_LVGL_PORT_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
bool PRTS_LVGLPortInit(void);
|
||||
uint32_t PRTS_LVGLPortGetFrameCount(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user