Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/micropython_lvgl_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
run: |
source tools/ci.sh && ci_stm32_setup
make -C ports/stm32 BOARD=PYBV11 submodules
make -j $(nproc) -C ports/stm32 BOARD=PYBV11 USER_C_MODULES=../../user_modules LV_CONF_PATH=../../user_modules/lv_binding_micropython/ports/stm32/lv_conf_stm32.h
make -j $(nproc) -C ports/stm32 BOARD=PYBV11 USER_C_MODULES=../../user_modules LV_CONF_PATH=$(pwd)/user_modules/lv_binding_micropython/ports/stm32/lv_conf_stm32.h
# Raspberry Pi Pico port
- name: Build rp2 port
if: matrix.port == 'rp2'
Expand All @@ -88,7 +88,7 @@ jobs:
run: |
source tools/ci.sh && ci_esp32_idf_setup
source tools/ci.sh && ci_esp32_build_common
make -C ports/esp32 BOARD=ESP32_GENERIC_S3 USER_C_MODULES=../../user_modules/lv_binding_micropython/micropython.cmake
make -C ports/esp32 BOARD=ESP32_GENERIC_S3

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: This removes the LVGL user module from the ESP32 build, so the job no longer compiles the binding. Restore the USER_C_MODULES=../../user_modules/lv_binding_micropython/micropython.cmake argument or include the module another way.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At .github/workflows/micropython_lvgl_ci.yml, line 91:

<comment>This removes the LVGL user module from the ESP32 build, so the job no longer compiles the binding. Restore the `USER_C_MODULES=../../user_modules/lv_binding_micropython/micropython.cmake` argument or include the module another way.</comment>

<file context>
@@ -88,7 +88,7 @@ jobs:
         source tools/ci.sh && ci_esp32_idf_setup
         source tools/ci.sh && ci_esp32_build_common
-        make -C ports/esp32 BOARD=ESP32_GENERIC_S3 USER_C_MODULES=../../user_modules/lv_binding_micropython/micropython.cmake
+        make -C ports/esp32 BOARD=ESP32_GENERIC_S3
 
     # Unix port
</file context>
Suggested change
make -C ports/esp32 BOARD=ESP32_GENERIC_S3
make -C ports/esp32 BOARD=ESP32_GENERIC_S3 USER_C_MODULES=../../user_modules/lv_binding_micropython/micropython.cmake


# Unix port
- name: Build unix port
Expand Down
6 changes: 6 additions & 0 deletions gen/gen_mpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -1832,7 +1832,13 @@ def register_int_ptr_type(convertor, *types):

unsigned long long val = 0;
bool big_endian = !(__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__);
// mp_obj_int_to_bytes() replaced mp_obj_int_to_bytes_impl() in MicroPython
// 1.29 (commit e00daa3a), adding is_signed and overflow_check parameters.
#if MICROPY_VERSION >= MICROPY_MAKE_VERSION(1, 29, 0)
mp_obj_int_to_bytes(obj, sizeof(val), (byte*)&val, big_endian, false, false);
#else
mp_obj_int_to_bytes_impl(obj, big_endian, sizeof(val), (byte*)&val);
#endif
return val;
}

Expand Down
6 changes: 6 additions & 0 deletions gen/lv_mpy_example.c
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,13 @@ STATIC unsigned long long mp_obj_get_ull(mp_obj_t obj)

unsigned long long val = 0;
bool big_endian = !(__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__);
// mp_obj_int_to_bytes() replaced mp_obj_int_to_bytes_impl() in MicroPython
// 1.29 (commit e00daa3a), adding is_signed and overflow_check parameters.
#if MICROPY_VERSION >= MICROPY_MAKE_VERSION(1, 29, 0)
mp_obj_int_to_bytes(obj, sizeof(val), (byte*)&val, big_endian, false, false);
#else
mp_obj_int_to_bytes_impl(obj, big_endian, sizeof(val), (byte*)&val);
#endif
return val;
}

Expand Down
2 changes: 1 addition & 1 deletion micropython.mk
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ $(LVGL_MPY): $(ALL_LVGL_SRC) $(LVGL_BINDING_DIR)/gen/gen_mpy.py
-I $(LVGL_BINDING_DIR)/pycparser/utils/fake_libc_include \
-I $(LVGL_BINDING_DIR)/stubs/include \
$(CFLAGS_USERMOD) \
$(LVGL_DIR)/lvgl_private.h | $(LV_PP_FILTER) > $(LVGL_PP)
$(LVGL_DIR)/lvgl.h | $(LV_PP_FILTER) > $(LVGL_PP)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: This switches the generator input from lvgl_private.h to lvgl.h, so private LVGL symbols are now only generated when LV_USE_PRIVATE_API is enabled. The default lv_conf.h enables it, so the default build is fine, but a user config that disables it will silently drop those bindings. Please note this change in the PR description, since it is not covered by the stated purpose of the PR.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At micropython.mk, line 93:

<comment>This switches the generator input from `lvgl_private.h` to `lvgl.h`, so private LVGL symbols are now only generated when `LV_USE_PRIVATE_API` is enabled. The default `lv_conf.h` enables it, so the default build is fine, but a user config that disables it will silently drop those bindings. Please note this change in the PR description, since it is not covered by the stated purpose of the PR.</comment>

<file context>
@@ -90,7 +90,7 @@ $(LVGL_MPY): $(ALL_LVGL_SRC) $(LVGL_BINDING_DIR)/gen/gen_mpy.py
 		-I $(LVGL_BINDING_DIR)/stubs/include \
 		$(CFLAGS_USERMOD) \
-		$(LVGL_DIR)/lvgl_private.h | $(LV_PP_FILTER) > $(LVGL_PP)
+		$(LVGL_DIR)/lvgl.h | $(LV_PP_FILTER) > $(LVGL_PP)
 	$(Q)$(PYTHON) $(LVGL_BINDING_DIR)/gen/gen_mpy.py -M lvgl -MP lv -MD $(LVGL_MPY_METADATA) -E $(LVGL_PP) $(LVGL_DIR)/lvgl.h > $@
 
</file context>

$(Q)$(PYTHON) $(LVGL_BINDING_DIR)/gen/gen_mpy.py -M lvgl -MP lv -MD $(LVGL_MPY_METADATA) -E $(LVGL_PP) $(LVGL_DIR)/lvgl.h > $@

.PHONY: LVGL_MPY
Expand Down
Loading