Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lv_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,9 @@
#endif

/** Use NXP's VG-Lite GPU on iMX RTxxx platforms. */
#ifndef LV_USE_DRAW_VGLITE
#define LV_USE_DRAW_VGLITE 0
#endif

#if LV_USE_DRAW_VGLITE
/** Enable blit quality degradation workaround recommended for screen's dimension > 352 pixels. */
Expand All @@ -249,7 +251,9 @@
#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.*/
Expand Down
26 changes: 22 additions & 4 deletions micropython.mk
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
################################################################################
# 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
Expand All @@ -15,7 +18,7 @@ CFLAGS_USERMOD += $(SDL_CFLAGS_USERMOD) -DMICROPY_SDL=1
LDFLAGS_USERMOD += $(SDL_LDFLAGS_USERMOD)
endif

# Avoid including unwanted local headers other than sdl2
# Avoid including unwanted local headers other than sdl2
ifeq ($(UNAME_S),Darwin)
CFLAGS_USERMOD:=$(filter-out -I/usr/local/include,$(CFLAGS_USERMOD))
endif
Expand Down Expand Up @@ -43,7 +46,22 @@ 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


################################################################################

Expand Down Expand Up @@ -76,7 +94,7 @@ CFLAGS_USERMOD += -DLV_CONF_PATH='"$(LV_CONF_PATH)"'
# CFLAGS DEBUG
$(info CFLAGS_USERMOD is $(CFLAGS_USERMOD))

$(LVGL_MPY): $(ALL_LVGL_SRC) $(LVGL_BINDING_DIR)/gen/gen_mpy.py
$(LVGL_MPY): $(ALL_LVGL_SRC) $(LVGL_BINDING_DIR)/gen/gen_mpy.py
$(ECHO) "LVGL-GEN $@"
$(Q)mkdir -p $(dir $@)
$(Q)$(CPP) $(CFLAGS_USERMOD) -DPYCPARSER -x c -I $(LVGL_BINDING_DIR)/pycparser/utils/fake_libc_include $(INC) $(LVGL_DIR)/lvgl.h > $(LVGL_PP)
Expand Down
Loading