this commit includes lots of new code in ui/lvgl.zig and ui/widget.zig
to work with LVGL directly from zig. in fact, some C code is moved from
ui/c/ui.c to ui/xxx.zig.
in addition, a new module ui/widget.zig is where all custom UI elements
will reside. at the moment it comprises of the ported topdrop and a new
modal func. the latter is an alternative to LVGL's lv_msgbox popup.
as a practical example, the commit replaces the power off confirmation
popup with the new modal window.
functions declared in ui.h were actually used by ui.c, the opposite of
what such a header is expected to contain. these functions are defined
in zig code and declarations are better off in the same ui.c file.
this is just a quick clean up before porting some C code to zig.
ci/woodpecker/push/woodpecker Pipeline was successfulDetails
ci/woodpecker/tag/woodpecker Pipeline was successfulDetails
this is an attempt at identifying the underlying problem.
unclear whether this normal behaviour on a linux kernel or something to
do with zig implementation.
either way, pinging the UI makes CommReadInvalidTag error disappear on startup.
updates #16
ci/woodpecker/push/woodpecker Pipeline was successfulDetails
when the screen turns off, the idle loop never gave a chance CPU to
do other work and pegged at 100%. adding a short sleep each cycle
yields CPU to the OS.
closes #15
ci/woodpecker/push/woodpecker Pipeline was successfulDetails
ci/woodpecker/tag/woodpecker Pipeline was successfulDetails
passed 60 sec of no touch screen activity, daemon turns off backlight
and gui places a black "topdrop", opposite of backdrop. simply touching
the screen reactivates it immediately.
there seem to be no way to turn screen power off, so backlight plus
black topdrop is the next best.
there's no user settings to change 60 sec timeout at the moment because it
is unclear whether it's worth adding UI elements. can always do so later.
the implementation also provides means to reactivate the screen in
an event of an alert from the daemon in the future.
closes #3
the idea is for all zig code to use C LVGL only via this
new module lvgl.zig, all display and input driver/devices is handled
by drv.zig.
this makes C/zig nicely compartmentalized in just a handful places.
the nd/ngui protocol is a simple TLV: message tag, length and
a json-encoded payload. the issue is with the (tag, length) header which
was written/read by using raw memory pointers, such as
Writer.writeStruct. in addition, tag ordinal values were auto-generated
by the compiler.
all those deficiencies may potentially lead to bugs hard to find or
serious data leaks.
serializing and deserializing the (tag, length) header manually
makes it more robust and eliminates the footgun.
10min looks quite excessive but based on conversations in
https://github.com/bitcoin/bitcoin/commit/7fb7acfc, better safe than
sorry. same for lnd. in any case, 30sec was indeed far too short to
begin with, especially for bitcoind.
services are now stopped in parallel, though. so, the poweroff sequence
goes faster.
16px looks easier to read but IPv6 addresses don't fit in the wifi
settings panel anymore. need to find a better way how to display them or
change font.