Skip to content

Commit a22cd6a

Browse files
committed
Fix logging
1 parent ca3585b commit a22cd6a

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ Let's use the Zig Compiler to compile `lv_label.c` from C to WebAssembly....
470470

471471
- Add `-DFAR=` (because we won't need Far Pointers)
472472

473-
- Add `-DLV_USE_LOG` (to enable logging)
473+
- Add `-DLV_USE_LOG=1` (to enable logging)
474474

475475
- Add `-DLV_LOG_LEVEL=LV_LOG_LEVEL_TRACE` (for detailed logging)
476476

@@ -502,7 +502,7 @@ zig cc \
502502
-rdynamic \
503503
-lc \
504504
-DFAR= \
505-
-DLV_USE_LOG \
505+
-DLV_USE_LOG=1 \
506506
-DLV_LOG_LEVEL=LV_LOG_LEVEL_TRACE \
507507
-DLV_MEM_SIZE=1000000 \
508508
"-DLV_ASSERT_HANDLER={void lv_assert_handler(void); lv_assert_handler();}" \
@@ -561,7 +561,7 @@ Let's ask Zig Compiler to link `lv_label.o` with our Zig LVGL App [`lvglwasm.zig
561561
-rdynamic \
562562
-lc \
563563
-DFAR= \
564-
-DLV_USE_LOG \
564+
-DLV_USE_LOG=1 \
565565
-DLV_LOG_LEVEL=LV_LOG_LEVEL_TRACE \
566566
-DLV_MEM_SIZE=1000000 \
567567
"-DLV_ASSERT_HANDLER={void lv_assert_handler(void); lv_assert_handler();}" \

build.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,9 @@ function build_zig {
9090
-rdynamic \
9191
-lc \
9292
-DFAR= \
93-
-DLV_USE_LOG \
93+
-DLV_USE_LOG=1 \
9494
-DLV_LOG_LEVEL=LV_LOG_LEVEL_TRACE \
95+
-DLV_LOG_TRACE_OBJ_CREATE=1 \
9596
-DLV_MEM_SIZE=1000000 \
9697
"-DLV_ASSERT_HANDLER={void lv_assert_handler(void); lv_assert_handler();}" \
9798
-I . \
@@ -223,8 +224,9 @@ function compile_lvgl {
223224
-rdynamic \
224225
-lc \
225226
-DFAR= \
226-
-DLV_USE_LOG \
227+
-DLV_USE_LOG=1 \
227228
-DLV_LOG_LEVEL=LV_LOG_LEVEL_TRACE \
229+
-DLV_LOG_TRACE_OBJ_CREATE=1 \
228230
-DLV_MEM_SIZE=1000000 \
229231
"-DLV_ASSERT_HANDLER={void lv_assert_handler(void); lv_assert_handler();}" \
230232
\

lvglwasm.wasm

14.6 KB
Binary file not shown.

lvglwasm.zig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ pub export fn lv_demo_widgets() void {
6060
);
6161

6262
// Register the Display Driver
63+
debug("before lv_disp_drv_register", .{}); ////
6364
const disp = c.lv_disp_drv_register(disp_drv);
65+
debug("after lv_disp_drv_register", .{}); ////
6466
_ = disp;
6567

6668
// Create the widgets for display (with Zig Wrapper)
@@ -74,7 +76,9 @@ pub export fn lv_demo_widgets() void {
7476
// TODO: Call `lv_timer_handler()` every few milliseconds to handle LVGL related tasks
7577
var i: usize = 0;
7678
while (i < 10) : (i += 1) {
79+
debug("lv_timer_handler: start", .{});
7780
_ = c.lv_timer_handler();
81+
debug("lv_timer_handler: end", .{});
7882
}
7983
}
8084

0 commit comments

Comments
 (0)