-
-
Notifications
You must be signed in to change notification settings - Fork 339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(color): Replace static bitmap QR code with LVGL generated QR code #3880
Conversation
I am still thinking about a way to share model settings via QR Code and a camera in the TX |
Bluetooth/wifi link to your phone, app on your phone? 🤭 |
You'll have hard times encoding everything into a single QR code. Most apps doing this do upload everything and generate a single ID, which is exchanged via QR code, and then used to download whatever needs to be exchanged. |
@philmoz the most interesting question is: what is the impact on FLASH usage? Aka. is code more efficient than a pre-generated image? |
Replacing only a single QR image will use more FLASH for the LVGL QR library - ~6K on TX16S. |
Last main build:
This PR:
Given it opens up the avenue for more QR codes for other stuff, I can live with that... 90% is still far away (will regret that soon, I'm sure!) |
You didn't try the |
When the libopenui refactor PR is merged and it really saves 5kB, 2e are good. |
Not since 2.8.4, with extra heli and luamixer 🤭
|
Ouch - what causes that huge jump? |
The fonts.... They are quite huge for asian languages (especially |
TW character set is a lot bigger than our paltry English one... plus that firmware still has all the binary conversion support, and luamixer on top. |
So we need a ttf font renderer and cache used symbols in Ram? |
I was about to add a qr code for undisclosed hardware so I vote for this ! |
RTTI costs about 78K on my TX16S build. Unfortunately it's required for a handful of places where dynamic_cast is being used. Has anyone tried to get this of this? |
Where are dynamic casts used? |
Screen layouts and widgets. |
Can it be used to generate qrcode in *.png that is saved to SD? I have qrcode LUA but it is so calculation intensive that is almost killing MCU. |
Possibly. Rendering to an off screen canvas should be ok; but not sure about saving to a png file. |
LVGL can load binary format fonts from files. Binary fonts can be created with the lv_font_conv program by changing the output format. I've mocked up a quick test of this to load the XL and XXL fonts from the SD card instead of embedding them in the firmware. Tested and working in the simulator and TX16S. If the fonts can't be loaded then the L font is used instead. Any thoughts - is it worth developing further? It would require adding font files to the SD card content. |
If XL and XXL are indeed not used by the non lua stuff (and likely not used by most lua add on either) then it would be something to look at as a side pr to reduce flash usage, imho |
d5d3a00
to
e45605b
Compare
If you do research XXLSIZE is used mostly for numbers. There are 2 or 3 cases LUA dev used it for text. Not important though as "No Value" can be replaced with '-'. So if it matters for reducing firmware size I'd left XXL font, but change it - so it contains Numbers & Special Characters like '-', ':' |
This functionality could also be used in future to add 'help' links to pages.