1
0
Fork 0
Commit graph

585 commits

Author SHA1 Message Date
Daniel Thompson
88347f9c7c tools: wasptool: Better REPL integration
Add a run_command method for the "console". This allows running a command
on the target and capturing the result. Normally this is handled using
REPLWrapper but that doesn't work well with the NUS console because local
echo gets in the way.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-02-21 17:01:36 +00:00
Daniel Thompson
80c340b005 tools: wasptool: Add push/pull commands
--push is very similar to --binary --upload but handles directories
differently. --pull allows us to copy binary files from the target.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-02-21 09:53:49 +00:00
Daniel Thompson
19db3d6398 README: Update the intro after a redraft for the release announcement
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-02-20 12:32:28 +00:00
Daniel Thompson
1f827866d3 TODO: Finalize v0.4 changelog
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-02-20 11:50:04 +00:00
Daniel Thompson
8bc1f358d8 TODO: Describe goals for 0.5
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-02-20 11:49:48 +00:00
Daniel Thompson
2954c3b356 docs: install: Document the binary releases
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-02-20 11:49:27 +00:00
Piotr Tworek
0d76b1b186 st7789: Fix incorrect variable name in ST7789_SPIs. __init__ docstring.
The data signal pin name is dc, not cs.

Signed-off-by: Piotr Tworek <tworaz@tworaz.net>
2021-02-20 08:46:59 +00:00
Shuhao Wu
268f8c06e9 Added Docker setup to build wasp-os.
This should make it a bit easier for people to contribute. Also fixed
the documentations on how to setup on Debian, as certain recommended
packages don't exist.

Signed-off-by: Shuhao Wu <shuhao@shuhaowu.com>
2021-02-20 08:44:22 +00:00
Daniel Thompson
090ed8489b apps: settings: Clamp the dates a little more tightly
Currently a couple of down presses on the year results in the time being
set to some time in 2099. The micropython date logic does not support
dates this far in the future and throws an exception. Adopt a simple
fix that should be OK for the next 39 years ;-) .

Reported-by: Christopher Peters <me@christopherp.de>
Fixes: #167
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-02-20 08:42:16 +00:00
Daniel Thompson
a0ee26a412 docs: install: Fix typo in apt-get line for buster
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-02-11 18:53:13 +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
kozova1
28dbc66376
drivers: draw565: Added bounding_box() function that returns the size of a string.
This function returns a tuple of (width, height) of the string,
as it would appear if used in draw.string()

Signed-off-by: kozova1 <mug66kk@gmail.com>
2021-02-05 16:42:01 +02:00
Daniel Thompson
a124734ff2 draw565: Fix an out-by-one error in _bounding_box
Currently we add an extra blank pixel to the end of the string but this
is not required.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-02-04 22:15:59 +00:00
Daniel Thompson
463ba50d2b apps: testapp: Ensure we test centred strings
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-02-04 22:15:45 +00:00
Isaiah Grace
c686e2cae0 apps: settings: Added labels to the dates
Signed-off-by: Isaiah Grace <isaiah@graces.com>
2021-02-03 20:20:21 +00:00
Daniel Thompson
a5b2e5ec69 install: Correct the wasptool dependencies
Fixes: a1b1502d92 ("install: Include the wasptool dependencies in the install guide")
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-02-03 18:01:17 +00:00
Daniel Thompson
a1b1502d92 install: Include the wasptool dependencies in the install guide
Fixes: #159
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-01-30 12:55:28 +00:00
Daniel Thompson
40be05d261 apps: musicplayer: Adopt GfxButton and use it for trace fwd/back
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-01-18 21:55:02 +00:00
Daniel Thompson
6e269d5cd7 widgets: Add a button with a graphical icon
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-01-18 21:52:55 +00:00
Daniel Thompson
fbc806721e drivers: st7789: Further reduce allocations during set_window()
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-01-17 17:44:50 +00:00
Daniel Thompson
6b41c8f3db drivers: st7789: Pre-allocate a memoryview
Reduce the cost of slicing the linebuffer by pre-allocating a memoryview.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-01-17 17:44:21 +00:00
Daniel Thompson
5abae5a7f6 drivers: st7789: Optimize set_window()
For small graphical items (line drawing, font glyphs) the performance
of the set_window() method is critical.

Emit native code for this function and optimize the SPI write_cmd()
method to avoid memory allocation. This give a performance boost of
a little over 15% for (24pt) font rendering and 30% for line drawing.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-01-17 16:08:27 +00:00
Daniel Thompson
2fe3ac1388 draw565: Optimize string drawing
Avoid needless bouncing the chip select when drawing glyphs. This
improved performance by around 15% for 24pt fonts.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-01-17 16:03:42 +00:00
Daniel Thompson
5170b97491 docs: appguide: Document how to upload pre-compiled files
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-01-17 14:55:57 +00:00
Daniel Thompson
2805c1f84e docs: install: Clarify watch mode during updates
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-01-16 09:44:43 +00:00
George Griffin
ae6e2ff289 Disallow swipes while confirmation prompt is displayed
Signed-off-by: George Griffin <george@menomnom.com>
2021-01-15 20:08:57 +00:00
Daniel Thompson
f4f7aac7fd system: Move free memory capture into the switch method
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-01-15 20:07:09 +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
727bc8c685 docs: Move all applications out of the reference guide
The auto-generated application docs isn't really worthy of the reference
guide. There's too  many methods described as "draws the screen" and this
simply doesn't add anything over the template application includes in
the application writer's guide.

Move everything over into the Application Library.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-01-13 22:06:26 +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
a80c7dea17 docs: Add a link to the latest video
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-01-12 20:55:16 +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
05310a82f8 widgets: Clarity whether spinner max is inclusive or exclusive
Currently the spinner uses exclusive max when wrapping from low to high
and inclusive max when wrapping from high to low. Fix this by adopting
*inclusive* max everywhere. The call sites are similarly confused.

Fix this!

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-01-12 20:22:44 +00:00
Daniel Thompson
9314eeafbc docs: Normalize the timer app screenshot
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-01-12 19:18:42 +00:00
Daniel Thompson
394525b1d3 docs: Update calculator screenshot
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-01-12 19:15:40 +00:00
ChristianRomberg
bf27f1e351 system: Fix app unregister function
Replace undefined 'instanceof' with 'isinstance'

Signed-off-by: Christian Romberg <distjubo@gmail.com>
2021-01-12 19:11:57 +00:00
Daniel Thompson
62288cc81e apps: software: Fix some scrolling bugs
Currently the number of pages is (acidentally) hardcoded where it need
not be and the scroll directions aren't right as soon as we go beyond
two pages (where scroll up and down are equivalent actions).

Fix both.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-01-10 18:14:36 +00:00
Daniel Thompson
79db167ed9 apps: play2048: Optimized the icon a little
wasp-os uses a rather eccentric "2-bit" RLE encoding which works best
when there are only three colors (and black) in a single line. Modify
the screenshot slightly to allow it to be encoded with fewer palette
updated.
2021-01-10 18:14:36 +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
Miguel Rochefort
8a07edb4d8 widgets: ConfirmationView: Restore default font
The title will render with the last font used, and this isn't always
right for the ConfirmationView. Setting the font explicitly solves that
issue.

Signed-off-by: Miguel Rochefort <miguelrochefort@gmail.com>
2021-01-10 18:13:31 +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
4e9a576a2d docs: Add some main.py examples
These still need to be integrated into the generated documentation but
there were included in the most recent wasp-os video so let's get them
into the source code.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-01-10 15:19:42 +00:00
Daniel Thompson
1670be2672 apps: music: Update the application icon
Switch from a headphone to music notation metaphor and take the (lazy?)
approach of using the watch chassis to frame the icon.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-01-10 15:17:27 +00:00
Daniel Thompson
e79625685d wasptool: Allow files to be renamed during an upload
For example:

    ./tools/wasptool --upload docs/main/chrono.py --as main.py

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-01-10 14:49:36 +00:00
Daniel Thompson
6de86a64ed TODO: Update the roadmap ready for a 0.4 release.
Admitedly we can become "ready" by reducing the scope a little. On the
other hand there's been some big steps forward in terms of new applications
so I'd like to refocus the 0.4 release to showcase those new apps.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-01-10 14:19:06 +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