The logo module is currently unused but it simply sits there consuming
flash. Let's shift it to the demo app to is can consume RAM instead (but
only when we upload the demo to the watch).
sx is measured in pixels (2-bytes) and len(display.linebuffer) gives
a value in bytes so the divisor isn't right.
Whilst we are here let's make sure we use integer division too.
Fixes: #18
wasp-os contains circular import dependancies (wasp includes apps which
include wasp) but this is normally harmless.
However using __init__.py exagerated to the problem and since the benefit
of the __init__ file is pretty anyway the let's just remove it.
The code to recalculate the uptime to walltime adjustment was broken
(e.g. the longer we leave it after reboot the more inaccurate the time
setting becomes).
Fixes: 80079e4 ("wasp: nrf_rtc: Add a tiny bit of extra resolution")
We now have a couple of applications (stopwatch, Game of Life) that benefit
from sub-second precision. The micropython RTC/utime code for nrf still
needs a major overhaul but this allows us to paper over the cracks for
just a little longer.
On nRF devices if we print with the NUS console disconnected (instead
of never connected) then things we can end up hanging. Better only
to print an exception if the watch class contains a method to do
that.
This is getting us much closer to the final UI concept. We have a
quick ring from which we can select typical apps such as clock and
stopwatch which will (eventually) be supplemented with step counting
and heart rate monitoriing. More exotic apps (currenrtly torch, self
test, settings) are all relagated to the launcher ring.
There are still some holes here. In particular the RTC resolution on
nRF devices (such as PineTime) is currently a full second (meaning
the centiseconds will always be zero. Nevertheless that isn't the apps
fault... as we can see when we run on the simulator.
If an application crashes let's report it on the device so it can be
distinguished from a hang (if nothing else it should mean we get better
bug reports).
There's a bunch of different changes here but there are only really three
big wins. The biggest win comes from restructuring the 2-bit RLE decode
loop to avoid the inner function (~20%) but the switch to 16-bit writes in
_fill() and adoption of quick_write (e.g. no CS toggling) are also
note worthy (and about 5% each).
As we enrich the navigation options we will increasinly need to visualize
between apps where up/down will switch us between rings and there
up/down is needed to scroll through content.
This might be a reasonable preference for the setings but, more importantly,
we can also set blank_after to very high values to ensure the watch doesn't
sleep during the voice over in videos!
This gives the simulator a more natural feel since the "swipe left" action
usually means "more a screen to the right". This will probably make
testing games impossible but makes it much easier to navigate the menus.
Here the biggest changes are in the test application because we
refactor a number of the tests to make better use of the button.
Although applications may consume button events it does have a
default behavior which is to switch to the default application
(usually the clock).
After a bit of testing I have not yet come up with a fast, visually
acceptable horizontal animated effect. Instead we simply reply on
screen blanking during the redraw... meaning there is no need for an
effect hint.
This is a big change that break compatiblity with existing applications
*and* with existing installed versions of main.py.
When upgrading it is import to update main.py:
./tools/wasptool --upload wasp/main.py
This is something of an experiment but now the app roll is traversed using
horizontal swipes and applications should primarily use vertical swipes
to navigate internally. This is mostly because if "feels" better but it
also leaves the vertical scrolling hardware available for use by the
app.
This makes line-by-line drawing more efficient because don't have to
handle the dc line. The optimization targets font rendering and if good
for slightly less than 10% rendering improvement.
Moving it from applications into the watch is useful for two reasons.
Firstly it means applications don't need to know as much about the
display color depth and secondly it makes it easier to replace the
drawing routines with wasptool.
We now generate documentation for everything included in the PineTime
manifest (although, at this stage, not everything in the manifest has
all the required docstrings).
In addition to the fix (which is simple) we also modify the button handling
of the simulator because, rather by acident, it relies on the bugs in the
battery meter redraw to ensure the simulator stays active.