From ff8dc2af8fd95d1fecbc075bb3cd6dbac0199114 Mon Sep 17 00:00:00 2001 From: Brad Barnett <127794626+bdbarnett@users.noreply.github.com> Date: Fri, 25 Sep 2026 09:52:10 -0500 Subject: [PATCH] windows pydevices variant: run built-in module __init__ on import 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. --- variants/windows/pydevices/mpconfigvariant.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/variants/windows/pydevices/mpconfigvariant.h b/variants/windows/pydevices/mpconfigvariant.h index a5ffe18c..8d8d8130 100644 --- a/variants/windows/pydevices/mpconfigvariant.h +++ b/variants/windows/pydevices/mpconfigvariant.h @@ -3,3 +3,7 @@ // -X heapsize= still overrides it. Needs patch 0012. #include "variants/dev/mpconfigvariant.h" #define MICROPY_UNIX_DEFAULT_HEAP_SIZE (8 * 1024 * 1024) +// Run a built-in module's __init__ on import, as unix does. The windows port +// sits at the core ROM level, where this is off, so `import jpegio` after +// lv.init() never registered displayif's LVGL decoder (displayif#41). +#define MICROPY_MODULE_BUILTIN_INIT (1)