Skip to content

Commit d4a72f2

Browse files
committed
[simulator][lvgl] 处理注释
1 parent e72eb1a commit d4a72f2

File tree

6 files changed

+13
-17
lines changed

6 files changed

+13
-17
lines changed

bsp/qemu-vexpress-a9/drivers/drv_clcd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ int drv_clcd_hw_init(void)
109109

110110
_lcd.width = CLCD_WIDTH;
111111
_lcd.height = CLCD_HEIGHT;
112-
_lcd.fb = rt_malloc_align(_lcd.width * _lcd.height * 2, 32);
112+
_lcd.fb = rt_malloc(_lcd.width * _lcd.height * 2);
113113
if (_lcd.fb == NULL)
114114
{
115115
rt_kprintf("initialize frame buffer failed!\n");

bsp/qemu-vexpress-a9/drivers/lvgl/lv_demo.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@
2323

2424
static void lvgl_thread(void *parameter)
2525
{
26+
/* display demo; you may replace with your LVGL application at here */
2627
extern void lv_demo_music(void);
2728
lv_demo_music();
2829

30+
/* handle the tasks of LVGL */
2931
while(1)
3032
{
3133
lv_task_handler();

bsp/qemu-vexpress-a9/drivers/lvgl/lv_port_disp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,14 @@ void lv_port_disp_init(void)
116116
RT_ASSERT(info.bits_per_pixel == 8 || info.bits_per_pixel == 16 ||
117117
info.bits_per_pixel == 24 || info.bits_per_pixel == 32);
118118

119-
fbuf1 = rt_malloc_align(info.width * info.height * sizeof(lv_color_t), 32);
119+
fbuf1 = rt_malloc(info.width * info.height * sizeof(lv_color_t));
120120
if (fbuf1 == RT_NULL)
121121
{
122122
rt_kprintf("Error: alloc disp buf fail\n");
123123
return;
124124
}
125125

126-
fbuf2 = rt_malloc_align(info.width * info.height * sizeof(lv_color_t), 32);
126+
fbuf2 = rt_malloc(info.width * info.height * sizeof(lv_color_t));
127127
if (fbuf2 == RT_NULL)
128128
{
129129
rt_kprintf("Error: alloc disp buf fail\n");

bsp/simulator/drivers/lvgl/lv_demo.c

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,8 @@
1212
#define DBG_LVL DBG_INFO
1313
#include <rtdbg.h>
1414
#include <lvgl.h>
15-
#include <lv_port_disp.h>
1615
#include <win32drv.h>
1716

18-
#define IDI_LVGL 101
19-
2017
#ifndef LV_THREAD_STACK_SIZE
2118
#define LV_THREAD_STACK_SIZE 4096
2219
#endif
@@ -28,28 +25,25 @@
2825
static void lvgl_thread(void *parameter)
2926
{
3027
/* initialize win32 driver; don't put this in lv_port_disp() */
31-
if (!lv_win32_init(
32-
GetModuleHandleW(NULL),
33-
SW_SHOW,
34-
BSP_LCD_WIDTH,
35-
BSP_LCD_HEIGHT,
36-
LoadIconW(GetModuleHandleW(NULL), MAKEINTRESOURCE(IDI_LVGL))))
28+
if (!lv_win32_init(GetModuleHandleW(NULL), SW_SHOW, BSP_LCD_WIDTH, BSP_LCD_HEIGHT, NULL))
3729
{
3830
LOG_E("lv_win32_init failure!");
3931
return;
4032
}
41-
4233
lv_win32_add_all_input_devices_to_group(NULL);
4334

44-
/* display demo */
35+
/* display demo; you may replace with your LVGL application at here */
4536
extern void lv_demo_music(void);
4637
lv_demo_music();
4738

39+
/* handle the tasks of LVGL */
4840
while (!lv_win32_quit_signal)
4941
{
5042
lv_task_handler();
51-
Sleep(1);
43+
rt_thread_mdelay(1);
5244
}
45+
46+
LOG_W("LVGL simulator window closed!");
5347
}
5448

5549
static int lvgl_demo_init(void)

bsp/simulator/drivers/lvgl/lv_port_disp.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
extern "C" {
1515
#endif
1616

17-
#include <win32drv.h>
18-
1917
void lv_port_disp_init(void);
2018

2119
#ifdef __cplusplus

bsp/stm32/stm32l475-atk-pandora/board/ports/lvgl/lv_demo.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ static void lvgl_thread(void *parameter)
2929
const lv_point_t points_array[] = {{200,35},{0,0},{70,35},{0,0}};
3030
lv_indev_set_button_points(button_indev, points_array);
3131

32+
/* display demo; you may replace with your LVGL application at here */
3233
lv_demo_calendar();
3334

35+
/* handle the tasks of LVGL */
3436
while(1)
3537
{
3638
lv_task_handler();

0 commit comments

Comments
 (0)