fix(draw_buf): use LV_ROUND_UP to align draw buffer address
From test config lv_test_conf.h: /*Use non power of 2 to avoid the case when `malloc` returns aligned pointer by default, and use a large value be sure any issues will cause crash*/ \#define LV_DRAW_BUF_ALIGN 852 We need to support non-power-of-2 draw buffer alignement. Introduce LV_ROUND_UP in lv_math.h and use it instead. Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
This commit is contained in:
@@ -29,6 +29,9 @@ extern "C" {
|
||||
/*Align up value x to align, align must be a power of two*/
|
||||
#define LV_ALIGN_UP(x, align) (((x) + ((align) - 1)) & ~((align) - 1))
|
||||
|
||||
/*Round up value x to round, round can be any integer number*/
|
||||
#define LV_ROUND_UP(x, round) ((((x) + ((round) - 1)) / (round)) * (round))
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
Reference in New Issue
Block a user