1
0
Fork 0
Commit graph

136 commits

Author SHA1 Message Date
Francesco Gazzetta
a956b3efe5 Include the gallery app in micropython.zip
...and move GameOfLife out to make space

The gallery app needs too much memory to run from bytecode, and has to
be frozen in micropython.zip instead

Signed-off-by: Francesco Gazzetta <fgaz@fgaz.me>
2022-03-27 08:58:22 +01:00
Francesco Gazzetta
4b7cf88576 Add watchface with weekday
* Allow overriding of date string in clock.py
* Override it to display the weekday in week_clock.py

Signed-off-by: Francesco Gazzetta <fgaz@fgaz.me>
2022-02-02 12:18:27 +00:00
Francesco Gazzetta
b8a50db03c Add DisaBLE app that disables bluetooth
Signed-off-by: Francesco Gazzetta <fgaz@fgaz.me>
2021-12-26 21:25:07 +00:00
Francesco Gazzetta
b5f4099fa6 Test and build docs for user defined apps too
Signed-off-by: Francesco Gazzetta <fgaz@fgaz.me>
2021-11-17 15:29:08 +00:00
Francesco Gazzetta
0eabf0f109 Remove morse from default apps
Even after optimizing it, it makes the image 224 bytes too big.

Signed-off-by: Francesco Gazzetta <fgaz@fgaz.me>
2021-11-17 15:29:08 +00:00
Francesco Gazzetta
c0065190b5 Add morse app
Signed-off-by: Francesco Gazzetta <fgaz@fgaz.me>
2021-11-17 15:29:08 +00:00
Daniel Thompson
59dff38811 k9, p8, pinetime: Fix initial filesystem creation
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-08-31 21:21:46 +01:00
Tait Berlette
dc40430faa apps: Fixed weather app with GadgetBridge.
When I created the weather app I didn't have GadgetBridge installed, so I tried to follow the protocol on the [espurino website](https://www.espruino.com/Gadgetbridge), but it wasn't very helpful and I made some mistakes. This commit should fix these mistakes to stop the weather app from crashing, and so it displays the correct values. I have also added a new settings option called "Units", where apps can see what units the user would prefer (metric/imperial).

Signed-off-by: Tait Berlette <54515877+taitberlette@users.noreply.github.com>
2021-08-23 20:09:02 +01:00
Daniel Thompson
0831f79a10 draw565: Improve line wrapping
Currently the final word of wrapped text will always appear as a single
word on its own line. Fix this by rearranging the break cases to avoid
searching for the most recent space when we get to the end of the text.

Fixes: #230
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-07-22 20:04:50 +01:00
Daniel Thompson
b59a5b1d37 wasp: Manager: Rewrite the startup logic
Reduce the number of applications imported by the manager and alter
the way applications are initially registered to allow main.py
complete control over the initial applications (but only if it wants
it).

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-06-20 19:25:31 +01:00
Daniel Thompson
b0bab534ff apps: SportsApp: Initial sports app implementation
This app is functional... although it lacking in almost every
costmetic way, from the icon to the main screen.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-06-20 17:24:10 +01:00
Daniel Thompson
9099c2398e widgets: Refactor the stopwatch as a widget
This is purely a refactoring for the purposes of code reuse. No change
of behaviour is expected.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-06-20 17:03:05 +01:00
Daniel Thompson
2d77ebc130 boards: simulator: main: Update the ChronoApp example
Currently the ChronoApp example code is both broken (missing apps. prefix)
and doesn't use the latest API for registering watch faces. Fix this.

Whilst here let's also provide an example for the DemoApp since that
is not included in the Software chooser.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-06-20 10:47:32 +01:00
Daniel Thompson
b6709997cc apps: DemoApp: Fully document the demo app
The demo app is of somewhat niche interest and is disabled by default
but arguable that makes it more important to document it fully since
this app is harder to find the many others.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-06-20 10:43:25 +01:00
Daniel Thompson
1a4b678b2b apps: FacesApp: Add a watch face chooser
This app is enabled by default and allows users to select a watch face
based on a fullscreen preview of how the app will draw the screen.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-06-20 10:28:27 +01:00
Daniel Thompson
4ad8273902 draw565: Fix bounding box calculations
wasp-os uses an drawing optimization technique to automatically place
a single pixel line on the right of glyphs when rendering them. This
results in a change to the bounding box for a rendered string (by adding
a single pixel on the right of the final character). Fix the bounding box
calculations accordingly. Among other things this eliminates graphical
artifacts when rendering labels in 2048.

Fixes: #203
Fixes: 58b5c0378e ("draw565: Optimize the string drawing")
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-06-04 10:46:25 +01:00
Tait Berlette
9ded8e28a6 Added weather application.
Signed-off-by: Tait Berlette <54515877+taitberlette@users.noreply.github.com>
2021-06-03 21:43:38 +01:00
thefenriswolf
ed3f1c1e71 fonts: add 18pt font
Signed-off-by: thefenriswolf <stefan.rohrbacher97@gmail.com>
[daniel@redfelineninja.org.uk: fixed up the manifest]
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-03-28 08:59:25 +01:00
Benoît HERVIER
7aa2ceb05b apps: Add DualClock app.
Signed-off-by: Benoît HERVIER <b@rvier.fr>
[daniel@redfelineninja.org.uk: Removed unused dual clock fonts from
clock_dual.py, fixed up the manifest]
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-03-27 09:41:54 +00:00
Daniel Thompson
86cc4844b6 apps: software: Include word clock in the available applications
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-03-10 21:50:01 +00:00
Daniel Thompson
474851219a boards: simulator: Increase the display blanking time
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-02-25 07:37:10 +00:00
Daniel Thompson
1cb1d96ef4 boards: simulator: Pick up out-of-bounds drawing
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>
2021-02-25 07:36:15 +00:00
Daniel Thompson
8940b7c3ab steplogger: Introduce code to perform data logging
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>
2021-02-21 20:27:48 +00:00
Daniel Thompson
f2ad6a7d3f simulator: test: Add Draw565.bounding_box unit tests
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-02-06 13:30:30 +00:00
Daniel Thompson
64d03fcc11 simulator: test_qa: Update to match latest policy
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-01-13 22:14:33 +00:00
Daniel Thompson
39d8783055 simulator: test_qa: Add some basic docstring tests
This one picked up a lot of inconsistancy so the changes here are pretty
big.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-01-13 21:51:17 +00:00
Daniel Thompson
f7ef165433 simulator: test_qa: Check that apps are includes in the library
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-01-12 22:33:25 +00:00
Daniel Thompson
aab718f917 simulator: test_qa: Add some simply QA tests for app screenshots
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>
2021-01-12 22:02:31 +00:00
Daniel Thompson
cca72ef348 apps: settings: Allow date and time to be set on the watch
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>
2021-01-12 20:27:52 +00:00
Miguel Rochefort
ffff5ae52b apps: play2048: Add the 2048 game application
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>
2021-01-10 18:14:36 +00:00
Daniel Thompson
bc9000c1a5 simulator: tests: Update after renaming the stopwatch app
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-01-10 16:07:15 +00:00
Wolfgang Ginolas
5b74c45e58 apps: timer: Add a countdown timer application
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>
2021-01-10 16:02:35 +00:00
Daniel Thompson
61c56598de boards: simulator: Add basic mute simulation
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>
2021-01-10 10:43:50 +00:00
Daniel Thompson
637f5d6e8a boards: simulator: Enable TestApp by default
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>
2021-01-10 10:40:03 +00:00
Daniel Thompson
ed242b84a6 widgets: ConfirmationView: Adopt the button widget
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>
2021-01-10 10:34:37 +00:00
Daniel Thompson
8325177ec8 sphinx: Fix docs build regression
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-01-03 17:29:35 +00:00
Daniel Thompson
3813eb2911 manager: Enable Software by default
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>
2021-01-03 14:59:14 +00:00
Daniel Thompson
62bca4d288 simulator: Better align simulator RTC API with the nRF API
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-29 16:07:37 +00:00
Daniel Thompson
ff76abfb8b draw565: Add lighten/darken functions
Add functions to generate shades from a single (usually theme provided)
basic palette colour.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-29 12:30:20 +00:00
Johannes Wache
a1ee40016d apps: calc: Created memory-saving calculator app
Signed-off-by: Johannes Wache <jbwa@posteo.de>
2020-12-28 12:06:51 +00:00
Daniel Thompson
0edee8067e simulator: Start with a higher initial voltage
Starting with the battery full makes testing the battery meter easier...

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-28 12:01:51 +00:00
Daniel Thompson
2034340f3b tests: Auto-discover applications and try to switch to them
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>
2020-12-26 18:07:45 +00:00
Daniel Thompson
784c9bb36d apps: testapp: Automatically report free memory
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-13 16:07:24 +00:00
Daniel Thompson
941d4a264d boards: simulator: Additional tests
Start to work (most of) the code paths in the self test application.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-12 18:15:15 +00:00
Daniel Thompson
e3b2c7bf7d boards: simulator: Improve spi.write() simulation
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-12 12:57:06 +00:00
Daniel Thompson
896a4e1a8d simulator: Suppress the pysdl2/numpy warning
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>
2020-12-04 20:35:16 +00:00
Daniel Thompson
46bd454392 simulator: test: Grey box stopwatch test
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>
2020-12-04 20:34:23 +00:00
Daniel Thompson
901e43870e simulator: tests: Parameterize the basic app tests
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-04 20:32:40 +00:00
Daniel Thompson
f1f5cc9e0c simulator: Introduce fully automatic testint
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>
2020-12-04 20:11:41 +00:00
Carlosgg
3fb1faceab Notify level in settings app
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>
2020-11-29 20:20:03 +00:00