Article: NuttX RTOS for PinePhone: Feature Phone UI in LVGL, Zig and WebAssembly
#45
@lupyuen
I got a bit stuck.  I am trying to add a gesture event handler to your LVGL featurephone Zig code.  I think it is a similar problem that I hit trying to pass the fn() for my interrupt handler over to C.  The magic zig spell doesn't seem to be documented, but then what is these days Wink

This code complains the function handle is optional but I dont understand why, or how to fix it.  If I pass null for the 'event_cb' param it compiles, so I think that is where the issue is...  any ideas please?


Code:
const handle: ?*c._lv_event_dsc_t = c.lv_obj_add_event_cb(c.lv_scr_act(), eventHandler, c.LV_EVENT_GESTURE, null);
    _ = handle;
...

pub fn eventHandler(event: ?*c.lv_event_t) callconv(.C) void {}

error:
Code:
eature-phone.zig:98:1: error: expected type
'*.home....cimport.struct__lv_obj_t'
, found
'?*.home....cimport.struct__lv_obj_t'
  Reply


Messages In This Thread
RE: Article: NuttX RTOS for PinePhone: Feature Phone UI in LVGL, Zig and WebAssembly - by WhiteHexagon - 08-02-2023, 12:58 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  baremetal via Zig on PinePhone - JumpDrive help please WhiteHexagon 1 294 07-07-2025, 10:33 AM
Last Post: WhiteHexagon
  Jami on the Pine phone ? bcnaz 8 8,668 06-09-2025, 04:17 PM
Last Post: j_s
  Movuan distribution for PinePhone merom 4 1,051 04-07-2025, 12:32 AM
Last Post: tllim
  How-To: Remote Control Your Phone from Desktop via VNC biketool 6 2,375 03-05-2025, 06:18 AM
Last Post: Kevin Kofler
  Latest firmware for PinePhone modem! Subsentient 105 176,525 02-02-2025, 08:47 PM
Last Post: bacydentir85
  Slarm64 on PinePhone [Unofficial Slackware ARM - 64 bit] acid andy 40 43,500 12-28-2024, 12:19 AM
Last Post: mara
  Office applications for the Pinephone Peter Gamma 2 1,470 09-05-2024, 09:22 AM
Last Post: Peter Gamma
  Struggle to install LibreOffice on the PinePhone Peter Gamma 50 47,493 07-26-2024, 10:35 PM
Last Post: Peter Gamma
  Why does Pine64 sabotage office on the Pinephone? Peter Gamma 5 2,499 07-04-2024, 07:34 AM
Last Post: Kevin Kofler
  Which word processor to choose for the Pinephone? Peter Gamma 16 9,701 06-22-2024, 07:28 AM
Last Post: Peter Gamma

Forum Jump:


Users browsing this thread: 1 Guest(s)