Skip to content

Commit f9dc7e1

Browse files
committed
Fixed log
1 parent 7190fc2 commit f9dc7e1

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -714,10 +714,21 @@ https://github.com/lupyuen/pinephone-lvgl-zig/blob/f81cc3148dd487abc7660b9e634d4
714714

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

717-
# Render LVGL App in Web Browser
717+
TODO
718+
719+
```text
720+
custom_logger: [Warn] (0.001, +1)
721+
lv_disp_get_scr_act:
722+
no display registered to get its active screen
723+
(in lv_disp.c line #54)
724+
```
725+
726+
# Initialise LVGL Display
718727

719728
TODO: Init LVGL
720729

730+
# Render LVGL App in Web Browser
731+
721732
TODO: Render LVGL Display
722733

723734
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)

lvglwasm.wasm

18.6 KB
Binary file not shown.

lvglwasm.zig

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,13 +143,12 @@ var elapsed_ms: u32 = 0;
143143

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

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

155154
///////////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)