Skip to content

Commit c8161dc

Browse files
danieldegrassenashif
authored andcommitted
modules: lvgl: provide alignment definition
For some systems, the display peripheral or GPU requires that buffers be aligned on a boundary for optimal performance. We already align display buffers using CONFIG_LV_ATTRIBUTE_MEM_ALIGN_SIZE, but some applications will rely on the definition of LV_ATTRIBUTE_MEM_ALIGN. Provide this definition so those buffers will be aligned as well. Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
1 parent 0469de9 commit c8161dc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

modules/lvgl/include/lv_conf.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
#ifndef ZEPHYR_MODULES_LVGL_LV_CONF_H_
99
#define ZEPHYR_MODULES_LVGL_LV_CONF_H_
1010

11+
#include <zephyr/toolchain.h>
12+
1113
/* Memory manager settings */
1214

1315
#define LV_MEMCPY_MEMSET_STD 1
@@ -42,6 +44,9 @@
4244
#define lv_snprintf snprintf
4345
#define lv_vsnprintf vsnprintf
4446

47+
/* Provide definition to align LVGL buffers */
48+
#define LV_ATTRIBUTE_MEM_ALIGN __aligned(CONFIG_LV_ATTRIBUTE_MEM_ALIGN_SIZE)
49+
4550
/*
4651
* Needed because of a workaround for a GCC bug,
4752
* see https://github.com/lvgl/lvgl/issues/3078

0 commit comments

Comments
 (0)