![]() |
Article: NuttX RTOS for PinePhone: Feature Phone UI in LVGL, Zig and WebAssembly - Printable Version +- PINE64 (https://forum.pine64.org) +-- Forum: PinePhone (https://forum.pine64.org/forumdisplay.php?fid=120) +--- Forum: PinePhone Software (https://forum.pine64.org/forumdisplay.php?fid=121) +--- Thread: Article: NuttX RTOS for PinePhone: Feature Phone UI in LVGL, Zig and WebAssembly (/showthread.php?tid=18353) |
RE: Article: NuttX RTOS for PinePhone: Feature Phone UI in LVGL, Zig and WebAssembly - WhiteHexagon - 07-28-2023 I got stuck with the audio again, and decided to look for other simple bits of the phone, I was thinking flash light LED ![]() ![]() https://lupyuen.github.io/articles/pio RE: Article: NuttX RTOS for PinePhone: Feature Phone UI in LVGL, Zig and WebAssembly - lupyuen - 07-29-2023 Haha @WhiteHexagon you're going great! I hit the same roadblocks that you mentioned, sometimes it helps to check out the source code from Linux / FreeBSD / U-Boot and see how they do it :-) RE: Article: NuttX RTOS for PinePhone: Feature Phone UI in LVGL, Zig and WebAssembly - WhiteHexagon - 07-31-2023 @lupyuen hehe easier said than done, that's why I gave up on the OpenGL ES / LIMA for now, its like navigating a new city with a mostly compatible map, and a guide book listing possible alternative street name signs, but then also not knowing how to drive ![]() Anyway I read your informative article about the LCD backlight, nice work figuring out the missing register for the PWM! although it didnt stop me from trying to use the wrong one at first ![]() btw I like your approach listening to how other software touches the registers, great idea! I found the motor control, but then reaslised I needed something asynchronous to switch it off again... So I have been playing with the Timer registers, thinking a 200ms delay and callback to switch it off would work. So that involved trying to move some interrupt code up into Zig, although I didnt get far. First I couldnt work out how to pass a Zig function handle down to the 'C' layer for the interrupt callback. So instead I tried a single call from C to Zig for all interrupts. That worked perfect for the first interrupt, but when I ported my VOL button code to use the same approach, I found my export fn within a struct ended up as a duplicate symbol on the zig side ![]() ![]() ![]() RE: Article: NuttX RTOS for PinePhone: Feature Phone UI in LVGL, Zig and WebAssembly - WhiteHexagon - 07-31-2023 Code: pub const I2S_PCM0 = IRQ(45); Oh and the code if you are interested. It works if I move the exported fn and lookup table up to the file level, but since that is also just a 'struct' in Zig, I thought this might work. RE: Article: NuttX RTOS for PinePhone: Feature Phone UI in LVGL, Zig and WebAssembly - WhiteHexagon - 08-02-2023 @lupyuen I got a bit stuck. I am trying to add a gesture event handler to your LVGL featurephone Zig code. I think it is a similar problem that I hit trying to pass the fn() for my interrupt handler over to C. The magic zig spell doesn't seem to be documented, but then what is these days ![]() This code complains the function handle is optional but I dont understand why, or how to fix it. If I pass null for the 'event_cb' param it compiles, so I think that is where the issue is... any ideas please? Code: const handle: ?*c._lv_event_dsc_t = c.lv_obj_add_event_cb(c.lv_scr_act(), eventHandler, c.LV_EVENT_GESTURE, null); error: Code: eature-phone.zig:98:1: error: expected type RE: Article: NuttX RTOS for PinePhone: Feature Phone UI in LVGL, Zig and WebAssembly - WhiteHexagon - 08-02-2023 I copied your button event handler, and now it compiles ![]() I had a look into lv_indev.c, specifically around where it tries to calculate the velocity of the movement, and I can see that 'act_point' and 'last_point' are generating the same value, hence no velocity. I'm investigating on the WASM side and see if I can work out what's going on. RE: Article: NuttX RTOS for PinePhone: Feature Phone UI in LVGL, Zig and WebAssembly - WhiteHexagon - 08-07-2023 Hi professor! so the best way to learn is to do, right? so this week I am studying your display driver article, and trying to recreate the steps in Zig, also based on the p-boot logs you analysed. This week has been all about tcon, and I am almost ready to test that... before hopefully starting on DE, but once again I am impressed with how much work you have put into this project! I hope I can return to the Audio stuff soon and return some knowledge. Although I spent some time just trying to understand the phrase 'deassert' ![]() ![]() ![]() ![]() RE: Article: NuttX RTOS for PinePhone: Feature Phone UI in LVGL, Zig and WebAssembly - lupyuen - 08-08-2023 Hihi @WhiteHexagon sorry the past week has been very stressful for me while merging Star64 into NuttX Mainline, but I'm so glad it's finally done! :-) So how can I help you now? Yeah getting Zig into LVGL / NuttX Kernel can be tricky, I might have some useful tricks :-) RE: Article: NuttX RTOS for PinePhone: Feature Phone UI in LVGL, Zig and WebAssembly - WhiteHexagon - 08-11-2023 Hi @lupyuen , congratulations on the milestone! You raced through that one ![]() ![]() So what is next for you? the educational plans? or LVGL on star64? ![]() Code: //step 1 - configure PLL RE: Article: NuttX RTOS for PinePhone: Feature Phone UI in LVGL, Zig and WebAssembly - lupyuen - 08-11-2023 Yep @WhiteHexagon, Zig is a really cool way to experiment with PinePhone Hardware! I'm so happy that some folks have started porting NuttX to PinePhone Pro! I'm helping to review their code. Also I'm now exploring NuttX for PineTab-V. So things are getting very interesting :-) |