Exceptions on th sleep path more or less kill the device (it is half
alseep and is not on... but not off enough for the power button to work.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Currently the not-implemented message provokes GadgetBridget into
issuing lots of annoying toaster messages. It's still useful for debugging
but let's disable it by default.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
This is useful for devices that do not have touchscreens. It can be used
to cycle through the quick ring and to check out notifications.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Currently the backlight is permanently on at its lowest level. The
backlight is so dim that this is almost impossible to detect. I only
found it when lying in a field in total darkness and observing that the
screen wasn't quite as black as I expected.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
The K9 is similar to the PineTime and P8 devices but does not appear
to use the CST[78]16 touch screen controllers. At present the protocol
is not known (readfrom yields all zeros, readfrom_mem provokes an
exception) so we have a hugely limited interface consisting of the side
button and the touchscreen interrupts (in other words we can treat the
touchscreen like a second button).
Works suprisingly well considering...
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
All the components (bootloader, reloader, micropython) has P8 support added
some time back but without full integration at the wasp-os level. Let's
add it!
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Notifier was a dumb name so make it better. Now that we have a decent
name it should be obvious how to handle the BLE connection status icon!
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
This requires a modified version of Gadgetbridge and currently works by
implementing the BangleJS protocol.
In Gadgetbridge ensure "Sync time" is *not* set and choose "Don't pair"
when adding the PineTime device.
This has two useful properties. Firstly it means the watch will be
maintained in the background, allowing the REPL to be used for
notifications and other updates. Secondly it will save a little bit
of power by reducing the work needed to handle spurious wake ups.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Currently the simulator relies on the keyboard to issue touchscreen
gestures and button presses. Fix this by adding swipe detection and
introducing a skin which gives us the capability to press the button
using touchscreens or pointer devices.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
The algorithm is fairly crude and the GUI is pretty simple but, if you stay
still for 10 seconds, there's a good chance of an accurate pulse
reading.
Of course if you jog on the spot for ten seconds it more likely to
calculate how many steps per minutes you are performing!
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
This avoids an implusive change in base value and makes the waveform a
little more interesting.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
The heart rate analysis step is still a work in progress but the current
app allows us to visualize the the results of the signal conditioning.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
The original approach is *really* bad at drawing vertical lines (it ends
up working a pixel at a time and works the chip select for each one.
Optimize both the pixel fill and the use of the line buffer. The result
is 20% faster for quarter screen fills, 3x for horizontal lines and 6x
for vertical lines.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
We also change the colour scheme slightly because the increased size of
the clock interferes visually with the main display when it is bright
white.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
There nothing in the docs to give the delay time required after a
reset. Currently we use 200ms because that appears on some older
code for BMA423 but is removed in more recent drivers. 50ms is still
a long time (for hardware) and has held up in testing.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Currently there's no fancy algorithms to estimate stride length. Just
pure simple step counting directly from the hardware's "intelligence
engine".
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
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.