diff --git a/docs/guides/build-circuitpython-firmware-with-lvgl.md b/docs/guides/build-circuitpython-firmware-with-lvgl.md index ec46f6e..c8e2bdd 100644 --- a/docs/guides/build-circuitpython-firmware-with-lvgl.md +++ b/docs/guides/build-circuitpython-firmware-with-lvgl.md @@ -73,20 +73,21 @@ them. For a worked example with a partition table, see `USER_C_MODULES`: ```bash -./build_mp.py --interpreter circuitpython --port unix \ - --modules /path/to/omnipython-lvgl/ports/circuitpython,pygraphics +./build_mp.py --interpreter circuitpython --port unix --modules lvgl,pygraphics ``` -`--modules` takes a short name for each module that lives in -micropython-pydevices and a full path for one that doesn't, such as this -port. The binary lands in `builds/circuitpython/unix/coverage/`. +`lvgl` is this port: `build_mp.py` fetches omnipython-lvgl at the commit its +`modules.lock` pins, or uses an `omnipython-lvgl` checkout beside it. To build +another checkout, name its port by path instead +(`--modules /path/to/omnipython-lvgl/ports/circuitpython,pygraphics`). The +binary lands in `builds/circuitpython/unix/coverage/`. For a board, name CircuitPython's port and board, and put `CIRCUITPY_GIFIO=0` at the end: ```bash ./build_mp.py --interpreter circuitpython --port espressif \ - --board --modules /path/to/omnipython-lvgl/ports/circuitpython CIRCUITPY_GIFIO=0 + --board --modules lvgl CIRCUITPY_GIFIO=0 ``` ## Check the build diff --git a/docs/guides/build-micropython-firmware-with-lvgl.md b/docs/guides/build-micropython-firmware-with-lvgl.md index 1c02f5d..860f2d9 100644 --- a/docs/guides/build-micropython-firmware-with-lvgl.md +++ b/docs/guides/build-micropython-firmware-with-lvgl.md @@ -66,6 +66,15 @@ several such files builds them all. `build_mp.py` does that for you: name the modules and it builds them on a port, with upstream's own boards. +```bash +./build_mp.py --port unix --modules lvgl,pygraphics +``` + +`lvgl` is this port: `build_mp.py` fetches omnipython-lvgl at the commit its +`modules.lock` pins, or uses an `omnipython-lvgl` checkout beside it. To build +another checkout, name its port by path instead +(`--modules /path/to/omnipython-lvgl/ports/micropython,pygraphics`). + Add `jpegio` when you want JPEG images: [Show JPEG images](show-jpeg-images.md) says why. diff --git a/docs/guides/show-jpeg-images.md b/docs/guides/show-jpeg-images.md index 2dbf6f0..63099db 100644 --- a/docs/guides/show-jpeg-images.md +++ b/docs/guides/show-jpeg-images.md @@ -36,7 +36,7 @@ Name jpegio when you build with [micropython-pydevices](https://github.com/PyDevices/micropython-pydevices): ```bash -./build_mp.py --port unix --variant pydevices --modules jpegio,lvgl-micropython +./build_mp.py --port unix --variant pydevices --modules jpegio,lvgl ``` On a build that has both, `jpegio.register_lvgl_decoder()` and diff --git a/ports/micropython/micropython.mk b/ports/micropython/micropython.mk index ea93ff9..d8b8894 100644 --- a/ports/micropython/micropython.mk +++ b/ports/micropython/micropython.mk @@ -88,8 +88,11 @@ USERMOD_DIRS += $(BINDINGS_DIR) # py.mk sorts the module directories and strips the first that matches, so # the root (a prefix of this directory) names every object here, this # module's own src/ included. A MicroPython that strips only this directory -# names src/ by it, hence the second spelling. -LVMP_OBJ = $(BUILD)/$(patsubst $(BINDINGS_DIR)/%,$(notdir $(BINDINGS_DIR))/%,$(1)) $(BUILD)/$(patsubst $(LVMP_DIR)/%,$(notdir $(LVMP_DIR))/%,$(1)) $(if $(findstring :,$(1)),,$(BUILD)/$(1)) +# names src/ by it, hence the second spelling. A spelling a pattern didn't +# match is still the absolute path, so every spelling whose part under +# $(BUILD) holds a colon is dropped, not only the third. $(BUILD) itself may +# hold a drive colon (an absolute build directory on Windows); that is fine. +LVMP_OBJ = $(addprefix $(BUILD)/,$(foreach o,$(patsubst $(BINDINGS_DIR)/%,$(notdir $(BINDINGS_DIR))/%,$(1)) $(patsubst $(LVMP_DIR)/%,$(notdir $(LVMP_DIR))/%,$(1)) $(1),$(if $(findstring :,$(o)),,$(o)))) $(foreach s,$(SOURCES),\ $(eval $(call LVMP_OBJ,$(s:.c=.o)): CFLAGS += $(LVMP_FLOAT_CFLAGS))) $(eval $(call LVMP_OBJ,$(LVMP_C:.c=.o)): CFLAGS += $(LVMP_FLOAT_CFLAGS))