添加信息

This commit is contained in:
sc committed 2026-01-14 01:13:22 +08:00
1 parent b185a8ec12
commit 115d1d12c3
22 files changed
+3619 -1829

No files matched your search

@@ -327,8 +327,7 @@ typedef struct
lv_obj_t *screen_do64;
lv_obj_t *screen_do65;
lv_obj_t *screen_do66;
lv_obj_t *screen_do67;
lv_obj_t *screen_name_do0;
lv_obj_t *screen_name_do0;
lv_obj_t *screen_name_do1;
lv_obj_t *screen_name_do2;
lv_obj_t *screen_name_do3;
@@ -337,7 +336,7 @@ typedef struct
lv_obj_t *screen_name_do6;
lv_obj_t *screen_name_do7;
lv_obj_t *screen_name_do8;
lv_obj_t *screen_name_do9;
lv_obj_t *screen_name_do09;
lv_obj_t *screen_name_do10;
lv_obj_t *screen_name_do11;
lv_obj_t *screen_name_do12;
@@ -418,6 +417,7 @@ typedef struct
lv_obj_t *screen_sys_name;
lv_obj_t *screen_machine_id;
lv_obj_t *screen_sys_id;
lv_obj_t *screen_sys_var;
lv_obj_t *g_kb_top_layer;
}lv_ui;
@@ -462,6 +462,7 @@ LV_FONT_DECLARE(lv_font_Alatsi_Regular_20)
LV_FONT_DECLARE(lv_font_simsun_21)
LV_FONT_DECLARE(lv_font_Acme_Regular_16)
LV_FONT_DECLARE(lv_font_Alatsi_Regular_18)
LV_FONT_DECLARE(lv_font_simsun_14)
LV_FONT_DECLARE(lv_font_montserratMedium_14)
LV_FONT_DECLARE(lv_font_simsun_32)
LV_FONT_DECLARE(lv_font_montserratMedium_30)
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+4 -1
View File
@@ -287,7 +287,7 @@ void ui_init_dio_leds(lv_ui *ui) {
do_name_array[6] = ui->screen_name_do6;
do_name_array[7] = ui->screen_name_do7;
do_name_array[8] = ui->screen_name_do8;
do_name_array[9] = ui->screen_name_do9;
do_name_array[9] = ui->screen_name_do09;
do_name_array[10] = ui->screen_name_do10;
do_name_array[11] = ui->screen_name_do11;
do_name_array[12] = ui->screen_name_do12;
@@ -357,6 +357,9 @@ void setup_user_screen(lv_ui *ui)
//lv_label_set_text(di_name_array[0], lang_get_str(0));
//lv_label_set_text(di_name_array[i], lang_get_str(di_table[i].name));
//lv_label_set_text(di_name_array[i], lang_get_str(di_table[i].name));
for (int i = 0; i < DI_TABLE_SIZE; i++)
{
+58 -18
View File
@@ -30,7 +30,9 @@
/**********************
* TYPEDEFS
**********************/
#define DBG_TAG "LVGLd"
#define DBG_LVL DBG_INFO
#include <rtdbg.h>
/**********************
* STATIC PROTOTYPES
**********************/
@@ -47,7 +49,15 @@ static void disp_flush(lv_disp_drv_t * disp_drv, const lv_area_t * area, lv_colo
/**********************
* MACROS
**********************/
static lv_disp_draw_buf_t draw_buf_dsc_1;
static lv_disp_draw_buf_t draw_buf_dsc_2;
static lv_disp_draw_buf_t draw_buf_dsc_3;
static lv_color_t *buf_1 = RT_NULL;
static lv_color_t *buf_2_1 = RT_NULL;
static lv_color_t *buf_2_2 = RT_NULL;
static lv_color_t *buf_3_1 = RT_NULL;
static lv_color_t *buf_3_2 = RT_NULL;
/**********************
* GLOBAL FUNCTIONS
**********************/
@@ -85,35 +95,65 @@ void lv_port_disp_init(void)
*/
/* Example for 1) */
static lv_disp_draw_buf_t draw_buf_dsc_1 __attribute__((aligned(4)));
static lv_color_t *buf_1 __attribute__((aligned(4))) = RT_NULL;
//static lv_disp_draw_buf_t draw_buf_dsc_1 __attribute__((aligned(8)));
//static lv_color_t *buf_1 __attribute__((aligned(8))) = RT_NULL;
//static lv_color_t buf_1[MY_DISP_HOR_RES * 10] __attribute__((section(".sdram"))); /*A buffer for 10 rows*/
buf_1 = (lv_color_t *)rt_memheap_alloc(&sdram_heap, sizeof(lv_color_t) * MY_DISP_HOR_RES * 10);
//buf_1 = (lv_color_t *)rt_memheap_alloc(&sdram_heap, sizeof(lv_color_t) * MY_DISP_HOR_RES * 10);
lv_disp_draw_buf_init(&draw_buf_dsc_1, buf_1, NULL, MY_DISP_HOR_RES * 10); /*Initialize the display buffer*/
//lv_disp_draw_buf_init(&draw_buf_dsc_1, buf_1, NULL, MY_DISP_HOR_RES * 10); /*Initialize the display buffer*/
/* Example for 2) */
static lv_disp_draw_buf_t draw_buf_dsc_2 __attribute__((aligned(4)));
static lv_color_t *buf_2_1 __attribute__((aligned(4)))= RT_NULL;
static lv_color_t *buf_2_2 __attribute__((aligned(4)))= RT_NULL;
//static lv_disp_draw_buf_t draw_buf_dsc_2 __attribute__((aligned(8)));
//static lv_color_t *buf_2_1 __attribute__((aligned(8)))= RT_NULL;
//static lv_color_t *buf_2_2 __attribute__((aligned(8)))= RT_NULL;
//static lv_color_t buf_2_1[MY_DISP_HOR_RES * 10] __attribute__((section(".sdram"))); /*A buffer for 10 rows*/
//static lv_color_t buf_2_2[MY_DISP_HOR_RES * 10] __attribute__((section(".sdram"))); /*An other buffer for 10 rows*/
buf_2_1 = (lv_color_t *)rt_memheap_alloc(&sdram_heap, sizeof(lv_color_t) * MY_DISP_HOR_RES * 10);
buf_2_2 = (lv_color_t *)rt_memheap_alloc(&sdram_heap, sizeof(lv_color_t) * MY_DISP_HOR_RES * 10);
//buf_2_1 = (lv_color_t *)rt_memheap_alloc(&sdram_heap, sizeof(lv_color_t) * MY_DISP_HOR_RES * 10);
//buf_2_2 = (lv_color_t *)rt_memheap_alloc(&sdram_heap, sizeof(lv_color_t) * MY_DISP_HOR_RES * 10);
lv_disp_draw_buf_init(&draw_buf_dsc_2, buf_2_1, buf_2_2, MY_DISP_HOR_RES * 10); /*Initialize the display buffer*/
//lv_disp_draw_buf_init(&draw_buf_dsc_2, buf_2_1, buf_2_2, MY_DISP_HOR_RES * 10); /*Initialize the display buffer*/
/* Example for 3) also set disp_drv.full_refresh = 1 below*/
static lv_disp_draw_buf_t draw_buf_dsc_3 __attribute__((aligned(4)));
static lv_color_t *buf_3_1 __attribute__((aligned(4)))= RT_NULL;
static lv_color_t *buf_3_2 __attribute__((aligned(4)))= RT_NULL;
//static lv_disp_draw_buf_t draw_buf_dsc_3 __attribute__((aligned(8)));
//static lv_color_t *buf_3_1 __attribute__((aligned(8)))= RT_NULL;
//static lv_color_t *buf_3_2 __attribute__((aligned(8)))= RT_NULL;
//static lv_color_t buf_3_1[MY_DISP_HOR_RES * MY_DISP_VER_RES] __attribute__((section(".sdram"))); /*A screen sized buffer*/
//static lv_color_t buf_3_2[MY_DISP_HOR_RES * MY_DISP_VER_RES] __attribute__((section(".sdram"))); /*Another screen sized buffer*/
buf_3_1 = (lv_color_t *)rt_memheap_alloc(&sdram_heap, sizeof(lv_color_t) * MY_DISP_VER_RES * 10);
buf_3_2 = (lv_color_t *)rt_memheap_alloc(&sdram_heap, sizeof(lv_color_t) * MY_DISP_VER_RES * 10);
//buf_3_1 = (lv_color_t *)rt_memheap_alloc(&sdram_heap, sizeof(lv_color_t) * MY_DISP_VER_RES * 10);
//buf_3_2 = (lv_color_t *)rt_memheap_alloc(&sdram_heap, sizeof(lv_color_t) * MY_DISP_VER_RES * 10);
lv_disp_draw_buf_init(&draw_buf_dsc_3, buf_3_1, buf_3_2, MY_DISP_HOR_RES * MY_DISP_VER_RES ); /*Initialize the display buffer*/
//lv_disp_draw_buf_init(&draw_buf_dsc_3, buf_3_1, buf_3_2, MY_DISP_HOR_RES * MY_DISP_VER_RES ); /*Initialize the display buffer*/
// 使用对齐分配函数
buf_1 = (lv_color_t *)rt_memheap_alloc_align(&sdram_heap,
sizeof(lv_color_t) * MY_DISP_HOR_RES * 10,
4); // ← 关键:对齐到 4 字节
buf_2_1 = (lv_color_t *)rt_memheap_alloc_align(&sdram_heap,
sizeof(lv_color_t) * MY_DISP_HOR_RES * 10,
4);
buf_2_2 = (lv_color_t *)rt_memheap_alloc_align(&sdram_heap,
sizeof(lv_color_t) * MY_DISP_HOR_RES * 10,
4);
buf_3_1 = (lv_color_t *)rt_memheap_alloc_align(&sdram_heap,
sizeof(lv_color_t) * MY_DISP_HOR_RES * MY_DISP_VER_RES,
4);
buf_3_2 = (lv_color_t *)rt_memheap_alloc_align(&sdram_heap,
sizeof(lv_color_t) * MY_DISP_HOR_RES * MY_DISP_VER_RES,
4);
if (!buf_1 || !buf_2_1 || !buf_2_2 || !buf_3_1 || !buf_3_2) {
LOG_E("Failed to alloc aligned draw buffers");
}
// 初始化 draw buffer
lv_disp_draw_buf_init(&draw_buf_dsc_1, buf_1, NULL, MY_DISP_HOR_RES * 10);
lv_disp_draw_buf_init(&draw_buf_dsc_2, buf_2_1, buf_2_2, MY_DISP_HOR_RES * 10);
lv_disp_draw_buf_init(&draw_buf_dsc_3, buf_3_1, buf_3_2, MY_DISP_HOR_RES * MY_DISP_VER_RES);
/*-----------------------------------
* Register the display in LVGL
*----------------------------------*/
@@ -131,7 +171,7 @@ void lv_port_disp_init(void)
disp_drv.flush_cb = disp_flush;
/*Set a display buffer*/
disp_drv.draw_buf = &draw_buf_dsc_1;
disp_drv.draw_buf = &draw_buf_dsc_2;
/*Required for Example 3)*/
//disp_drv.full_refresh = 1;