Repository navigation
windows pydevices variant: run built-in module __init__ on import - #18
Merged
Merged
Conversation
The windows port sits at the core ROM level, where MICROPY_MODULE_BUILTIN_INIT is off, so micropython.exe never ran jpegio's __init__ and `import jpegio` after lv.init() left LVGL without the jpegio decoder (PyDevices/displayif#41). Unix gets it from the extra-features level; the windows variant now sets it directly.
bdbarnett
added a commit
to PyDevices/displayif
that referenced
this pull request
Sep 25, 2026
…41) (#43) test_jpegio_lvgl.py now fails when `import jpegio` after lv.init() registers nothing on linux, darwin or win32, naming MICROPY_MODULE_BUILTIN_INIT. The windows half needs PyDevices/micropython-pydevices#18, which turns the hook on in the PyDevices windows variant; the README says so and tells other windows builds to call register_lvgl_decoder().
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For PyDevices/displayif#41.
With this,
micropython.exeregisters jpegio's LVGL decoder onimport jpegiothe way unix does. The windows port is at the core ROM level, whereMICROPY_MODULE_BUILTIN_INITis off, so jpegio's__init__never ran there. The pydevices windows variant now turns it on. That's one line invariants/windows/pydevices/mpconfigvariant.h, and the vst3-engine variant is unchanged.I built it with upstream's make, cross-compiled, into its own build directory (
ports/windows/build-desk-jpegio, the kitchen-sink manifest, under the build lock), and ran the same script on each interpreter:displayif's
tests/jpegio/test_jpegio_lvgl.pypasses in full on this build: 3 exact digests, the file source, memory, and the deinit/init cycle. PyDevices/displayif#43 makes that test require import-time registration on win32. It fails on the currentbin/micropython.exe, so it catches the missing hook.After this merges,
tools/build_interpreters.sh --only mp-windowsin the anchor puts it inbin/micropython.exe. I didn't rebuild the shared binaries.