Has there been an attempt to port LVGL into Espruino?
It seems like a nice UI library and apparently supports ESP32.
I've no idea how to port the code over to run under Espruino, but would be interested to learn.
Has anyone got any experience of this that they could help me with?
Sounds like a good idea! I originally read this thinking probably not, but when scouring the internet, it could be possible...
LVGL has the following system requirements that could be a make-or-break deal:
With the Pixl.js (which would be ideal given that it has a display), it's probably not possible: iirc you're given around 40 KiB to play with when the Espruino firmware/interpreter is installed. With some of the non-Bluetooth boards, I believe that they have a much higher spec, so it probably could fit on a few of the other Espruino products.
As you say, you'd have to port the code over to Espruino, which would require quite a lot of effort since it's probably a top-down rewrite of over roughly 383,002 source lines of code (according to a Chrome extension I installed for GitHub), so pretty big task. By no means impossible though ─ LVGL would only make up around 14% of the Espruino source code if both codebases were merged!
I admit that I'm not an expert at writing C myself (more of a JS guy ─ I've only written a bunch of small C programs!), but it sounds like an interesting project for those who have more experience at C. Defo a pl that I want to learn since it's so interesting, anyway!
One thing that would work is just using Espruino's own UI library ─ I mean, you can't go wrong there! I haven't used it myself (I implemented my own basic UI library for a project I've been working on), but it seems to be somewhat powerful given the limitations of the Espruino hardware. It works on the Espruinos with screens, and that includes the Pixl.js if you have one, as well as some of the other boards.
Hope this helps!
383,002 lines sounds like a lot of effort!
I figured it might not have needed rewriting as it seems to have been designed to be integrated, and be ported to other languages. I however know almost nothing about whats involved so I think I will gracefully step back from this one!
Yeah, it's certainly a lot! Though as you say, the code may be quite modular, and so probably only the code that talks to the hardware would need to be changed a bit.
There's certainly a lot of files in their codebase, and I'm taking a guess that some of them are related to driving/controlling the hardware peripherals, and then other parts are just code that interface with the hardware-controlling code ─ much like a Hardware Abstraction Layer, or HAL, found in modern operating systems.
Don't worry about formatting, just type in the text and we'll take care of making sense of it. We will auto-convert links, and if you put asterisks around words we will make them bold.
For a full reference visit the Markdown syntax.
© Espruino, powered by microcosm.
Report a problem