Skip to content

Commit

Permalink
Display buffer OK but nothing in canvas
Browse files Browse the repository at this point in the history
  • Loading branch information
lupyuen committed May 28, 2023
1 parent 8c4fd0c commit 2e1c97e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -880,6 +880,24 @@ https://github.com/daneelsan/Dodgeballz/tree/master/src

https://github.com/daneelsan/zig-wefx/blob/master/wefx/WEFX.zig

TODO: Font

```bash
## Compile LVGL Library from C to WebAssembly with Zig Compiler
compile_lvgl font/lv_font_montserrat_14.c lv_font_montserrat_14
compile_lvgl font/lv_font_montserrat_20.c lv_font_montserrat_20

## Compile the Zig LVGL App for WebAssembly
zig build-lib \
-DLV_FONT_MONTSERRAT_14=1 \
-DLV_FONT_MONTSERRAT_20=1 \
-DLV_FONT_DEFAULT_MONTSERRAT_20=1 \
-DLV_USE_FONT_PLACEHOLDER=1 \
...
lv_font_montserrat_14.o \
lv_font_montserrat_20.o \
```

# TODO

TODO: Call `lv_tick_inc` and `lv_timer_handler`
Expand Down
7 changes: 6 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ function build_zig {
compile_lvgl ../../../../../pinephone-lvgl-zig/display.c display.o

## Compile LVGL Library from C to WebAssembly with Zig Compiler
compile_lvgl font/lv_font_montserrat_14.c lv_font_montserrat_14.o
compile_lvgl font/lv_font_montserrat_20.c lv_font_montserrat_20.o
compile_lvgl widgets/lv_label.c lv_label.o
compile_lvgl core/lv_obj.c lv_obj.o
compile_lvgl misc/lv_mem.c lv_mem.o
Expand Down Expand Up @@ -80,10 +82,10 @@ function build_zig {
compile_lvgl draw/lv_draw_layer.c lv_draw_layer.o
compile_lvgl misc/lv_style_gen.c lv_style_gen.o
compile_lvgl misc/lv_gc.c lv_gc.o
compile_lvgl misc/lv_utils.c lv_utils.o

## Compile the Zig LVGL App for WebAssembly
## TODO: Change ".." to your NuttX Project Directory
## TODO: Try `zig build-exe` to fix `strlen` missing
zig build-lib \
--verbose-cimport \
-target wasm32-freestanding \
Expand Down Expand Up @@ -123,6 +125,8 @@ function build_zig {
\
lvglwasm.zig \
display.o \
lv_font_montserrat_14.o \
lv_font_montserrat_20.o \
lv_label.o \
lv_mem.o \
lv_obj.o \
Expand Down Expand Up @@ -184,6 +188,7 @@ function build_zig {
lv_draw_layer.o \
lv_style_gen.o \
lv_gc.o \
lv_utils.o \

## Compile the Zig LVGL App for PinePhone
## (armv8-a with cortex-a53)
Expand Down
Binary file modified lvglwasm.wasm
Binary file not shown.

0 comments on commit 2e1c97e

Please sign in to comment.