Providing a status bar for all apps to use allows us to reduce allocations
within the applications.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
The main simplification is to adopt the status bar (with the status bar
clock disabled) and to restructure the way draw and redraw are handled.
Since the clock application is one of the most popular to customize it
has also had extensive commenting added to describe how it works.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Currently if the real battery level is <5% then a redraw from scratch will
not draw the outline of the battery. Fix this by adding a special case for
negative previous states (-1 charging, -2 redraw).
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
This is intended to be reused by any app that shows the clock as part
of the status bar at the top of the display.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
For some users the icon is pointless because they would rather install
the clock on the quick ring but this clock is something of a novelty so
it would be quite reasonable to only launch it when in the mood for
decoding something!
Happily the icon compresses nicely too!
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
This also adds the Fibonaci Clock, Haiku viewer and the Game of Life
to the manifest. They are *not* registered by default at this point
since, although we can currently spare the internal flash space there
is more competition for RAM so we have to trade off out-of-the-box
convenience with keeping as much RAM as possible for users to do
"cool things".
Given the zen of wasp-os is to try to make is as easy as possible for
users to become coders we currently favour reserving the space for the
cool things (and implicitly encouraging them to write a couple of lines
of python to enable the bonus applications.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Signed-off-by: Johannes Wache <jbwa@posteo.de>
[daniel@redfelineninja.org.uk: Tidy up the "git soup", dropped the manifest
changes and integrated the description from the original PR into the
docstring for the app]
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
This app serves as an example of using the filesystem to make an
application more flexible. Both the verses and the icon will be
loaded from the filesystem rather than being burned into the
wasp-os binaries.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Having an extra identifier for the Pin() is a waste of RAM... if you need
the CS pin then grab it from watch.flash._cspins instead.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Wake from deep power down is now handled in the driver. Remove attempt
to wake the board files.
Signed-off-by: Jeffrey Bailey <wb.jeffrey@gmail.com>
[daniel@redfelineninja.org.uk: Update commit message, simplify
slightly, extended to all boards with spinor flash and update
gitmodules to bring in the flash driver updates.]
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Currently the simulator cannot run correctly because the indentation
in Manager.__init__ mixes tab and spaces. This is something CPython3
doesn't like but MicroPython is ok about.
Fix the obvious by using correct indentation.
Fixes: 889115f ("wasp: Allow app initialization to fail")
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Currently with CST816S controllers (but not CST716S controllers) then a
swipe delivered whilst the device is asleep will sometimes be processed
after we wake it up. That's never likely to be useful. Fix this by
explicitly clearing the event buffer as part of the wakeup sequence.
Reported-by: Siroj42 <siroj42@users.noreply.github.com>
Fixes: #65
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Colmi has released a new revision of the P8 hardware based on a different
accelerometer. That makes it impossible for the StepCounterApp to
initialize and currently this takes down the whole GUI due to the
uncaught exception.
Fix this by skipping applications that will not initialize.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
The screenshot is automatically named after the application currently
running and copied into the res/ directory. This allows the application
screenshots to be quickly updates if/when the screenshots get out of date
as the applications are improved.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
On a device with NEXT support we need to make sure we reset the stopwatch
when switching away from it (if it is not running) since there may not
be any other way to reset it.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
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>