Skip to content

Commit 67982bc

Browse files
committed
(feat) Add basic mimxrt support.
Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
1 parent f33add0 commit 67982bc

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

lv_conf.h

Lines changed: 5 additions & 1 deletion
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. */
252-
#define LV_USE_PXP 0
254+
#ifndef LV_USE_DRAW_PXP
255+
#define LV_USE_DRAW_PXP 0
256+
#endif
253257

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

micropython.mk

Lines changed: 17 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,17 @@ 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+
MOD_DIRNAME := $(notdir $(abspath $(USERMOD_DIR)))
55+
$(BUILD)/$(MOD_DIRNAME)/lvgl/src/draw/nxp/pxp/lv_draw_pxp.o: CFLAGS_USERMOD += -Wno-error=unused-variable
56+
$(BUILD)/$(MOD_DIRNAME)/lvgl/src/draw/nxp/pxp/lv_draw_pxp_img.o: CFLAGS_USERMOD += -Wno-error=float-conversion
57+
58+
endif # mimxrt support
59+
4760

4861
################################################################################
4962

@@ -76,7 +89,7 @@ CFLAGS_USERMOD += -DLV_CONF_PATH='"$(LV_CONF_PATH)"'
7689
# CFLAGS DEBUG
7790
$(info CFLAGS_USERMOD is $(CFLAGS_USERMOD))
7891

79-
$(LVGL_MPY): $(ALL_LVGL_SRC) $(LVGL_BINDING_DIR)/gen/gen_mpy.py
92+
$(LVGL_MPY): $(ALL_LVGL_SRC) $(LVGL_BINDING_DIR)/gen/gen_mpy.py
8093
$(ECHO) "LVGL-GEN $@"
8194
$(Q)mkdir -p $(dir $@)
8295
$(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)