-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Add pawn scripting language #2395
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
base: main
Are you sure you want to change the base?
Conversation
|
Build size and comparison to main:
|
|
This looks super cool. Question: could the example program here live in ROM rather than static memory (I assume that's where the +600 is coming from)? Otherwise if all programs live in RAM all the time I think it'll be really tough memory wise |
|
Yeah, we can even dynamically load the program from the external flash in small chunks to the RAM |
|
Cool, so if we made that char array @JF002 would be very interesting to hear your thoughts on this |
This is just to remove the erroneous data segment size change, there's no functional change
Compiled with pawncc -O3 -d0 -S:50
|
I've implemented the chunk loading I mentioned, now the code will only use up to 512 bytes (configurable, should probably be closer to a couple KBs). Obviously right now it's useless since it's loading from program ROM, but when loading from external flash it will also act as an LRU cache |
|
Awesome :) How does calling native functions e.g. LVGL functions work? Can we autogenerate bindings or do we need to implement our own micro-API for apps/watchfaces. I guess I'm not opposed to a micro-API anyway as we can make it more user friendly |
|
I was thinking of a mix of autogenerating bindings for LVGL and some auxiliary functions on top, e.g. the handful currently provided. Some sort of high level API would definitely make the programs smaller although I don't know what such an API would look like; both options are definitely possible |
|
I've reimplemented the digital watchface in Pawn here and removed the original one. I'm not sure if we should actually do this or not but it's a good exercise, although if we do we could consider moving it to the external flash to free up internal flash space |
This PR adds very rudimentary support for using the Pawn language to write apps and watchfaces and load them at runtime. It's only a proof of concept right now, it simply loads a hardcoded program from ROM (source below) and runs it when the digital watchface is shown or the Pawn app is opened (the one with a
Picon).There's still a lot of work left to be done, but I wanted to know your thoughts before fully sending it. We should also include the Pawn code as a submodule instead of vendoring the files directly.
This PR replaces the digital watchface implementation with a Pawn one whose source code is in the
watchface_digital.pfile.Simple hello world example: