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 · 0 comments
Open

lvgl v9.2.0 support broken. #361

andrewleech opened this issue Nov 13, 2024 · 0 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.

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

1 participant