Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lvgl v9.2.0 support broken. #361

Open
andrewleech opened this issue Nov 13, 2024 · 2 comments
Open

lvgl v9.2.0 support broken. #361

andrewleech opened this issue Nov 13, 2024 · 2 comments

Comments

@andrewleech
Copy link

I've attempted to build against LVGL v9.2.0 and while it compiles, I get an error thrown at runtime from code like:

def HomeBtnBlockB_eventhandler(event_struct):
   event = event_struct.code
   if event == lv.EVENT.CLICKED and True:
      print("clicked")

ui_HomeBtnBlockB = lv.imagebutton(ui_Home)
ui_HomeBtnBlockB.add_event_cb(HomeBtnBlockB_eventhandler, lv.EVENT.ALL, None)

The add_event_cb() function throws:

Traceback (most recent call last):
  File "app.py", line 23, in <module>
  File "lvgl/demo1/export/ui.py", line 227, in <module>
SyntaxError: Cannot convert 'function' to pointer!

In the generated lv_mpy.c the error is thrown by:
image

event_cb = mp_to_ptr() won't accept a function, the exception is thrown from

&mp_type_SyntaxError, MP_ERROR_TEXT("Cannot convert '%s' to pointer!"), mp_obj_get_type_str(self_in)));

I've bisected lvgl and narrowed down this change in behavior to lvgl/lvgl@1d14386b
Before this it works fine.

@Carglglz
Copy link

Carglglz commented Dec 5, 2024

See https://github.com/lvgl/lvgl/blob/master/docs/CHANGELOG.rst#breaking-changes, I had similar problems but I've just updated lv_conf.h in my branch 6a5eb88 and it seems to work now 👍🏼 (cc @Lzw655)

@Lzw655
Copy link

Lzw655 commented Dec 11, 2024

Hi @andrewleech @Carglglz, thank you very much for your efforts! I tested the branch 6a5eb88, and it indeed resolves this issue. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants