fix(color): minor fixes(#2767)

* fix(color): move LV_UDIV255 to lv_math.h

since lv_math.h is better place for the computation function

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>

* fix(color): replace the inifite loop with LV_ASSERT

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao
2021-11-08 03:54:13 -06:00
committed by GitHub
parent 3bd53b984d
commit a4978d0913
3 changed files with 5 additions and 7 deletions

View File

@@ -129,6 +129,7 @@ uint32_t lv_rand(uint32_t min, uint32_t max);
#define LV_CLAMP(min, val, max) (LV_MAX(min, (LV_MIN(val, max))))
#define LV_ABS(x) ((x) > 0 ? (x) : (-(x)))
#define LV_UDIV255(x) (((x) * 0x8081U) >> 0x17)
#define LV_IS_SIGNED(t) (((t)(-1)) < ((t) 0))
#define LV_UMAX_OF(t) (((0x1ULL << ((sizeof(t) * 8ULL) - 1ULL)) - 1ULL) | (0xFULL << ((sizeof(t) * 8ULL) - 4ULL)))