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
  Using Signal on PinePhone in mid-2023? dante404 47 14,761 05-03-2024, 02:19 AM
Last Post: dragonhospital
  Slarm64 on PinePhone [Unofficial Slackware ARM - 64 bit] acid andy 38 25,862 04-23-2024, 10:29 AM
Last Post: donchurch
  PinePhone app development WhiteHexagon 15 4,416 04-23-2024, 05:19 AM
Last Post: Jonnyc
Wink PINEPHONE not booting Touchwood 2 579 02-23-2024, 07:27 AM
Last Post: Touchwood
  Slack on PinePhone Adam Seline 5 5,576 12-20-2023, 07:20 AM
Last Post: nickolas
  Struggle to install LibreOffice on the PinePhone Peter Gamma 48 25,401 11-24-2023, 07:02 AM
Last Post: Peter Gamma
  Which word processor to choose for the Pinephone? Peter Gamma 8 2,252 11-23-2023, 01:06 AM
Last Post: Peter Gamma
  openSUSE for Pinephone Alefnode 75 103,726 11-17-2023, 08:37 AM
Last Post: Uturn
  Genode- Sculpt OS for the PinePhone (non Linux) Surehand53 1 1,103 11-04-2023, 07:23 PM
Last Post: tllim
  Abiword as a office mobile word processor for the Pinephone? Peter Gamma 11 2,571 10-24-2023, 08:57 AM
Last Post: Peter Gamma

Forum Jump:


Users browsing this thread: 1 Guest(s)