Currently, if we ask the simulator to draw out-of-bounds then it will
do exactly that, it will draw outside of the "screen" and corrupt the
pixels of the watch frame that surrounds it. This is an obviously poor
simulation of the real watch and when the out-of-bounds error is only
an out-by-one error can be easily overlooked until we load the code on
the device.
Let's just throw an exception if we draw out-of-bounds. That can easily
be picked up during testing.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
The code is not yet enabled by default but it can be tested by adding
custom code to an interested user's main.py .
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Add tests to make sure every app has a screenshot... and fix the
problems picked up by the new tests!
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Currently many first-time users excitedly install wasp-os and then
struggle to set the time using the various BLE based methods
(REPL, wasptool, GadgetBridge, etc). This results in "is there
another way to set the time" being *the* frequently asked
question.
Whilst getting the BLE tools is highly recommened to get the best
from wasp-os we can delivery a better out-of-the-box experience
for first time users is we provide on board date/time setting.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2048 is a popular sliding block puzzle game in which tiles are combined
to make the number 2048.
It's one of the few games that are enjoyable to play on such a small
form factor.
This started as a port of a TkInter implementation of the 2048 game. I
implemented all of the TkInter APIs used by the game and it worked on
wasp-os without any code change in the game. However, the performance
was very poor and it consumed too much RAM. I have since reimplemented
the whole game from scratch and managed to achieve acceptable
performance, although more improvements could still be made.
Because names in Python can't start with numbers, I had some trouble
naming things. The module is called "ttfe" (two-thousand-forty-eight),
the class name is Play2048App, and the software.py entry is "Play 2048".
Signed-off-by: Miguel Rochefort <miguelrochefort@gmail.com>
[daniel@redfelineninja.org.uk: Renamed the python filename, normalized
the screenshot and included the app in the docs]
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Signed-off-by: Wolfgang Ginolas <wolfgang.ginolas@gwif.eu>
[daniel@redfelineninja.org.uk: squashed into a single commit, rebase to
latest master, integrate with the Software application and rename the
screenshots to match the application name]
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Currently the simulator shows redraw artifacts that are concealed
on the real device by using display on/off. We can improve this by
avoiding the refresh when the display is off. This does not match
the behaviour of the real hardware (which goes dark during transitions)
but does make the simulator feel much more comfortable to use.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Relaunching the simulator to run tests quickly gets frustrating if
the Self Test is disabled by default. Change this.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Replace the pixelated Yes/No buttons with text based alternatives.
This also required changes to the pager to change the way the
redraw after changing view is implemented (improved muting and a reset
of the colours).
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Enabling software by default allows us disable several other applications
by default because there is now a GUI based route to enable them.
This does require a few tweaks to the test suite and allows allows us to
remove a lot of boilerplate text from the application library document
since it is no longer relavent.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Add functions to generate shades from a single (usually theme provided)
basic palette colour.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Currently `make check` doesn't test any not-default applications.
Fix this by automatically discovering constructors and ensure that the
application can be started and stopped without generating an exception.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
This makes the simulator look nicer when it starts up... but it
doesn't help the simulator.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Currently we can act on the controls but we cannot "see" the display
in the test suite. That leads us to a slightly odd form of "grey box"
testing. It's functionally black box testing but some of the asserts
have to reach inside the components instead of looking at the display.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Currently the tests do little more than fire up the simulator and
switch into (and out of) the built in applications. However this is
useful and allows us to fully integrate as a CI job.
Unfortunately the numpy warning from pysdl2 mean we have been forced
to disable all warnings to prevent pytest from collecting and reporting
them.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Signed-off-by: Carlos Gil Gonzalez <carlosgilglez@gmail.com>
[daniel@redfelineninja.org.uk: Fixed board support for simulator and
sphinx (a.k.a. doc builder)]
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Signed-off-by: Johannes Wache <jbwa@posteo.de>
[daniel@redfelineninja.org.uk: Removed some couple of unwanted merge artifacts]
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Like the other library applications this is enabled in the simulator and
included in the flash image but is disabled by default to conserve RAM
(and to give time to new apps to mature and receive improvements).
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Create a simple time queue where actions (functions or bound methods) can
be queued against the real time clock.
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Signed-off-by: Carlos Gil <carlosgilglez@gmail.com>
[daniel@redfelineninja.org.uk: fix regressions on simulator, disable by
default (for now) on real hardware and remove a couple of whitespace
changes to existing files]
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>
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>
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>
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.