1
0
Fork 0
Commit graph

62 commits

Author SHA1 Message Date
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
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
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
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
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
Johannes Wache
e450ccf9f0 apps: snake: Add a snake game application
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>
2020-11-29 20:08:59 +00:00
Daniel Thompson
233c136a5c apps: alarm: Add the alarm app to the library
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>
2020-11-29 19:14:31 +00:00
Daniel Thompson
d0a99d5636 manager: Implement alarm callbacks for applications to use
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>
2020-11-14 12:24:28 +00:00
Daniel Thompson
d2357f2325 simulator: Enable the music app in the simulator
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-11-12 21:47:38 +00:00
Daniel Thompson
06f1ed36b0 docs: Add an Application Library chapter
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-11-08 14:28:38 +00:00
Daniel Thompson
e8ae2ed47e boards: simulator: Add an screenshot facility
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>
2020-08-16 18:49:40 +01:00
Daniel Thompson
5ae327ea54 wasp: Introduce a NEXT event
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>
2020-08-15 17:00:49 +01:00
Daniel Thompson
326e06bc6b StatusBar: Rename and add BLE connection status icon
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>
2020-07-24 17:04:46 +01:00
Daniel Thompson
c739df119b boards: simulator: Swap up/down swipe detection
Fix swipe detection so it matches the real device.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-07-09 22:29:57 +01:00
Daniel Thompson
eac72188cf simulator: Provide a special main.py for the simulator
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-07-07 21:22:12 +01:00
Daniel Thompson
7b3e0f917d boards: simulator: Add swipe detection and button support
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>
2020-06-27 12:22:23 +01:00
Daniel Thompson
b1faec667d simulator: Reverse the simulated PPG waveform
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>
2020-06-24 21:20:47 +01:00
Daniel Thompson
88418fd1b5 apps: heart: Introduce simple app for the heart rate sensor
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>
2020-06-22 22:51:06 +01:00
Daniel Thompson
93b3c2bf1a wasp: simulator: Improve the RTC
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-06-12 08:49:54 +01:00
Fuji Pebri
df9d80f6f7 drivers: cst816s: optimize for power saving and responsiveness
Signed-off-by: Fuji Pebri <pebri86@gmail.com>
[daniel@redfelineinja.org.uk: removed leading underscore from method
arguments, removed redundant state tracking, adopt i2c.writeto_mem]
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-06-11 21:17:16 +01:00
Daniel Thompson
acf318c122 wasp: simulator: Add interupt support for CST816S
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-06-11 21:15:47 +01:00
Daniel Thompson
ccaf12750b wasp: apps: Step counter application
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>
2020-06-09 21:31:55 +01:00
Daniel Thompson
bfd914a5d1 boards: simulator: Add ptr32 support 2020-04-17 17:19:11 +01:00
Daniel Thompson
af1379806c wasp: simulator: Use Tab to replicate the physical button 2020-04-11 20:15:20 +01:00
Daniel Thompson
f68eb610c5 wasp: On-device crash reporting
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).
2020-04-11 20:15:02 +01:00
Daniel Thompson
fd64abe882 wasp: draw565: Optimize the 2-bit RLE drawing functions
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).
2020-04-08 21:50:42 +01:00
Daniel Thompson
59bb70fa64 wasp: simulator: Optimize the drawing process
This makes per-pixel access more than double the performnace of a regular
pixelview (but at the expense of requiring numpy).
2020-04-06 22:04:21 +01:00
Daniel Thompson
40b2482165 wasp: simulator: Swap up/down and left/right
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.
2020-04-06 22:04:20 +01:00
Daniel Thompson
b9fe31241c Add licensing information for all wasp-os files. 2020-03-22 15:40:18 +00:00
Daniel Thompson
5413d826d7 wasp: Re-factor how Draw565 is used.
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.
2020-03-08 23:16:30 +00:00