@pre @neil always open for a new watch face if you have a link
Try mine via https://codeberg.org/falken/wasp-os-apps ?
@falken Sure, he's my fork.
https://github.com/revpriest/pre-wasp-os
I do still intend to do a pull request eventually, but there's at least one bug still and seems like the maintainer prefers to have it all in one big chunk than deal with weekly pull requests as I find and fix the tiny things.
@falken Indeed. Micropython is a memory hog. Just storing a single int variable takes like 16 bytes.
Gotta write it tight to keep memory under control. I ended up allocating a word-array and indexing into that for all my variables.
@pre hmm. I'm new to embed systems.
Is the compiler clever enough that this is a good pattern and saves RAM over using two ints then? Eg it optimises away the two const ints:
vars=[]
const variable_one = 0
const something_else = 1
...
vars[something_else] = do_some_maths(vars[variable_one]
@falken I wouldn't wanna give the impression that I know what I'm doing exactly.
There's a micropython library called "const"
> from micropython import const
It means you can define names that are compile-time reduced without putting the names in the image:
> _FONTNUM = const(0)
You can then define a memory-chunk you need:
> self._wordvars = array.array("H",range(_MAXVARS))
[_MAXVARS is a const defined at the top more than all the others]
Then access them as needed:
> self._wordvars[_FONTNUM] = 0
Then each word-var is 16 bits instead of like 16 bytes even for a bool.
Doing that over having python objects for every variable was the biggest memory-saver.
@falken @neil
Ah, but you don't run the Monolithic Watch Face I made for it or the time-tracking app "Mood" I wrote ;)
Least probably not. It is open on my github but I doubt anyone is using it.