Skip to content

lvgl v9.2.0 support broken. #361

Closed
Closed
@andrewleech

Description

@andrewleech

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions