Skip to content

Commit 09a4d3c

Browse files
committed
(feat) Add basic mimxrt support.
Signed-off-by: Andrew Leech <[email protected]>
1 parent f33add0 commit 09a4d3c

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

lv_conf.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,9 @@
228228
#endif
229229

230230
/** Use NXP's VG-Lite GPU on iMX RTxxx platforms. */
231+
#ifndef LV_USE_DRAW_VGLITE
231232
#define LV_USE_DRAW_VGLITE 0
233+
#endif
232234

233235
#if LV_USE_DRAW_VGLITE
234236
/** Enable blit quality degradation workaround recommended for screen's dimension > 352 pixels. */
@@ -249,7 +251,9 @@
249251
#endif
250252

251253
/** Use NXP's PXP on iMX RTxxx platforms. */
254+
#ifndef LV_USE_PXP
252255
#define LV_USE_PXP 0
256+
#endif
253257

254258
#if LV_USE_PXP
255259
/** Use PXP for drawing.*/

micropython.mk

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1+
################################################################################
2+
# LVGL port Support
3+
MICROPY_PORT = $(notdir $(CURDIR))
14

5+
ifeq ($(MICROPY_PORT),unix)
26
################################################################################
37
# LVGL unix optional libraries
48
# Update CFLAGS_USERMOD and LDFLAGS_USERMOD for LVGL extenral library,
59
# but do that only on the unix port, for unix specific dependencies
6-
ifeq ($(notdir $(CURDIR)),unix)
710
ifneq ($(UNAME_S),Darwin)
811
CFLAGS_USERMOD += -DMICROPY_FB=1
912
endif
@@ -15,7 +18,7 @@ CFLAGS_USERMOD += $(SDL_CFLAGS_USERMOD) -DMICROPY_SDL=1
1518
LDFLAGS_USERMOD += $(SDL_LDFLAGS_USERMOD)
1619
endif
1720

18-
# Avoid including unwanted local headers other than sdl2
21+
# Avoid including unwanted local headers other than sdl2
1922
ifeq ($(UNAME_S),Darwin)
2023
CFLAGS_USERMOD:=$(filter-out -I/usr/local/include,$(CFLAGS_USERMOD))
2124
endif
@@ -43,7 +46,22 @@ endif
4346
# LDFLAGS_USERMOD += $(FFMPEG_LDFLAGS_USERMOD)
4447
# endif
4548

46-
endif
49+
endif # unix support
50+
51+
ifeq ($(MICROPY_PORT),mimxrt)
52+
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
53+
54+
# Depending on how the USER_C_MODULE is declared the object files inside build can be based on
55+
# absolute or relative paths under this directory.
56+
MOD_ABSPATH := $(abspath $(USERMOD_DIR))
57+
MOD_DIRNAME := $(notdir $(MOD_ABSPATH))
58+
$(BUILD)/$(MOD_ABSPATH)/lvgl/src/draw/nxp/pxp/lv_draw_pxp.o: CFLAGS_USERMOD += -Wno-error=unused-variable
59+
$(BUILD)/$(MOD_DIRNAME)/lvgl/src/draw/nxp/pxp/lv_draw_pxp.o: CFLAGS_USERMOD += -Wno-error=unused-variable
60+
$(BUILD)/$(MOD_ABSPATH)/lvgl/src/draw/nxp/pxp/lv_draw_pxp_img.o: CFLAGS_USERMOD += -Wno-error=float-conversion
61+
$(BUILD)/$(MOD_DIRNAME)/lvgl/src/draw/nxp/pxp/lv_draw_pxp_img.o: CFLAGS_USERMOD += -Wno-error=float-conversion
62+
63+
endif # mimxrt support
64+
4765

4866
################################################################################
4967

@@ -76,7 +94,7 @@ CFLAGS_USERMOD += -DLV_CONF_PATH='"$(LV_CONF_PATH)"'
7694
# CFLAGS DEBUG
7795
$(info CFLAGS_USERMOD is $(CFLAGS_USERMOD))
7896

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

0 commit comments

Comments
 (0)