diff --git a/lv_conf.h b/lv_conf.h index e37f8426f..406faead4 100644 --- a/lv_conf.h +++ b/lv_conf.h @@ -114,7 +114,9 @@ #define LV_DRAW_BUF_STRIDE_ALIGN 1 /** Align start address of draw_buf addresses to this bytes*/ +#ifndef LV_DRAW_BUF_ALIGN #define LV_DRAW_BUF_ALIGN 4 +#endif /** Using matrix for transformations. * Requirements: @@ -249,14 +251,20 @@ #endif /** Use NXP's PXP on iMX RTxxx platforms. */ +#ifndef LV_USE_PXP #define LV_USE_PXP 0 +#endif #if LV_USE_PXP /** Use PXP for drawing.*/ + #ifndef LV_USE_DRAW_PXP #define LV_USE_DRAW_PXP 1 + #endif /** Use PXP to rotate display.*/ + #ifndef LV_USE_ROTATE_PXP #define LV_USE_ROTATE_PXP 0 + #endif #if LV_USE_DRAW_PXP && LV_USE_OS /** Use additional draw thread for PXP processing.*/ diff --git a/micropython.mk b/micropython.mk index a884a4466..519cb5314 100644 --- a/micropython.mk +++ b/micropython.mk @@ -1,9 +1,13 @@ +################################################################################ +# LVGL port Support +MICROPY_PORT = $(notdir $(CURDIR)) + +ifeq ($(MICROPY_PORT),unix) ################################################################################ # LVGL unix optional libraries # Update CFLAGS_USERMOD and LDFLAGS_USERMOD for LVGL extenral library, # but do that only on the unix port, for unix specific dependencies -ifeq ($(notdir $(CURDIR)),unix) ifneq ($(UNAME_S),Darwin) CFLAGS_USERMOD += -DMICROPY_FB=1 endif @@ -43,7 +47,21 @@ endif # LDFLAGS_USERMOD += $(FFMPEG_LDFLAGS_USERMOD) # endif -endif +endif # unix support + +ifeq ($(MICROPY_PORT),mimxrt) +CFLAGS_USERMOD += -DLV_USE_PXP=1 -DLV_USE_DRAW_PXP=1 -DLV_USE_GPU_NXP_PXP=1 -DLV_USE_GPU_NXP_PXP_AUTO_INIT=1 + +# Depending on how the USER_C_MODULE is declared the object files inside build can be based on +# absolute or relative paths under this directory. +MOD_ABSPATH := $(abspath $(USERMOD_DIR)) +MOD_DIRNAME := $(notdir $(MOD_ABSPATH)) +$(BUILD)/$(MOD_ABSPATH)/lvgl/src/draw/nxp/pxp/lv_draw_pxp.o: CFLAGS_USERMOD += -Wno-error=unused-variable +$(BUILD)/$(MOD_DIRNAME)/lvgl/src/draw/nxp/pxp/lv_draw_pxp.o: CFLAGS_USERMOD += -Wno-error=unused-variable +$(BUILD)/$(MOD_ABSPATH)/lvgl/src/draw/nxp/pxp/lv_draw_pxp_img.o: CFLAGS_USERMOD += -Wno-error=float-conversion +$(BUILD)/$(MOD_DIRNAME)/lvgl/src/draw/nxp/pxp/lv_draw_pxp_img.o: CFLAGS_USERMOD += -Wno-error=float-conversion + +endif # mimxrt support ################################################################################