Skip to content

Commit

Permalink
Fixed log
Browse files Browse the repository at this point in the history
  • Loading branch information
lupyuen committed May 26, 2023
1 parent 7190fc2 commit f9dc7e1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -714,10 +714,21 @@ https://github.com/lupyuen/pinephone-lvgl-zig/blob/f81cc3148dd487abc7660b9e634d4

https://github.com/lupyuen/pinephone-lvgl-zig/blob/f81cc3148dd487abc7660b9e634d40735c42ccf8/lvglwasm.zig#L35-L39

# Render LVGL App in Web Browser
TODO

```text
custom_logger: [Warn] (0.001, +1)
lv_disp_get_scr_act:
no display registered to get its active screen
(in lv_disp.c line #54)
```

# Initialise LVGL Display

TODO: Init LVGL

# Render LVGL App in Web Browser

TODO: Render LVGL Display

TODO: Use Zig to connect the JavaScript UI (canvas rendering + input events) to LVGL WebAssembly [(Like this)](https://dev.to/sleibrock/webassembly-with-zig-pt-ii-ei7)
Expand Down
Binary file modified lvglwasm.wasm
Binary file not shown.
7 changes: 3 additions & 4 deletions lvglwasm.zig
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,12 @@ var elapsed_ms: u32 = 0;

/// TODO: Print a Stack Trace on Assertion Failure
export fn lv_assert_handler() void {
print(3000);
wasmlog.Console.log("lv_assert_handler: assertion failed", .{});
}

/// TODO: Custom Logger for LVGL
/// Custom Logger for LVGL that writes to JavaScript Console
export fn custom_logger(buf: [*c]const u8) void {
_ = buf;
print(4000);
wasmlog.Console.log("custom_logger: {s}", .{buf});
}

///////////////////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit f9dc7e1

Please sign in to comment.