1
0
Fork 0
Commit graph

166 commits

Author SHA1 Message Date
Francesco Gazzetta
867785edd9 Collect garbage before enabling apps
It especially helps loading big user defined apps.

Signed-off-by: Francesco Gazzetta <fgaz@fgaz.me>
2021-11-30 16:11:02 +01: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
0854adb630 Morse app: optimize letter lookup and constants
The dictionary of strings was taking a lot of space, and is now replaced
by a binary tree flattened into a string plus a small loookup function.

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
k
59c943d212 [alarms] Skip touch events on checkboxes of undefined alarms
Signed-off-by: k <k@klabz.org>
2021-10-16 10:37:25 +01:00
Rudy Ges
bd91a1076d HeartApp: draw black line ahead of cursor
Helps seeing where the cursor is when displaying data over previous screen

![image](https://user-images.githubusercontent.com/6101998/134028533-5f190252-ad71-43c5-accc-c2b7b6c49663.png)

Signed-off-by: k <k@klabz.org>
2021-10-16 10:32:34 +01:00
Rudy Ges
90411fb9f8 Calc app: fill gaps
Closes #262

Signed-off-by: k <k@klabz.org>
2021-10-16 10:32:03 +01:00
k
54e8f5771d [stopwatch] Fix refactoring remains
Closes #264

Signed-off-by: k <k@klabz.org>
2021-10-16 10:26:35 +01:00
Daniel Thompson
ba8546dd60 apps: software: Add support for user-defined applications
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-09-10 21:17:57 +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
2858826921 apps: Replace del self.x with self.x = None in all apps
Testing has demonstrated that del self.x does not make the memory used to
store x available for garbage collection.

There is clearly an additional reference from another place. In fact
*after* del self.x then the memory can be made available for GC by
assignment (e.g. self.x = None). However I haven't found how to release
this reference and there is nothing in self.__dict__ that can help.

For now we'll use a twp-step process where we set the variable to None
before deleting it.

This has a big impact on memory usage. For Software it is almost 1k
(a.k.a. about 10% impact on free RAM).

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-07-28 22:01:04 +01:00
Adam Blair
e09b951017 Advanced alarm app
Features:
* Multiple alarms (up to 4)
* Day of the week support
* One time alarms
* Snooze

Changes to wasp-os for app support:
* Added + and - to the 28pt and 36pt fonts
* Checkboxes now require a click on the body of the checkbox if there is no label
* Added a Toggle Button class that extends Button and stores a state like checkbox

Signed-off-by: Adam Blair <adampblair@protonmail.com>
2021-07-25 08:56:14 +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
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
2a1ac32279 all clocks: Add a preview() method ready for a watch face chooser
One benefit from wasp-os' dirt simple drawing model is that it is very
easy for apps to provide full screen previews of themselves. Add this
for all clocks ready for us to add a watch face chooser application.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-06-20 10:21: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
Daniel Thompson
92812e5ad2 apps: heart: Implement a debug mode to copy out raw data
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-05-05 21:06:39 +01:00
Daniel Thompson
69a989b97e apps: testapp: Force characters to render with a not-black background
This helps pick up any problems with the glpyh rendering.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-03-29 22:17:27 +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
Tait Berlette
79744770b0 apps: music: Change SWIPE_LEFTRIGHT to SWIPE_UPDOWN.
The music player volume control uses up and down events, but in the
foreground function the app requests left and right events.

Signed-off-by: Tait Berlette <54515877+taitberlette@users.noreply.github.com>
2021-03-27 09:08:36 +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
df5aa24d2d apps: software: Automatically track y position for checkboxes
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-03-10 21:33:22 +00:00
Brendan M. Sleight
cec8d97aeb apps: WordClock: Add a new word-based clock app
Signed-off-by: Brendan M. Sleight <bms.git@barwap.com>
[daniel@redfelineninja.org.uk: Squashed down into a single commit and
updated subject]
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk
2021-03-10 20:55:18 +00:00
Daniel Thompson
4879b7198e apps: steps: Reduce the graphing scale
Currently then even fast walking will run off the top of the graph. Change
the scale to that fast walking shows in full. I think at this level fast
running will probably run off the top but I need to gather a few more
details before settling on the final scale.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-03-01 20:03:07 +00:00
Daniel Thompson
7a5990072c apps: steps: Add a history graph
The steplogger records steps but currently there is no way to see the data
recorded on the device itself. Make a first attempt at graphing the
step data.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-02-25 08:00:03 +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
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
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
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
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
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
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
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
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
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
a6eab3e7ff system: Allows apps to be registered using strings
Use instance tests to identify strings and substitute then for an
instanciated class.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-01-10 10:37:25 +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
231f3b6fdd apps: software: Add an apps to enable/disable other apps
Currently wasp-os enables a narrow set of applications because we don't
want to consume RAM by importing the module and constructing the
application. We can improve on this situation by providing a small
(stateless) application that can be used to enable or diable applications.
This allows all the ROMed applications to be enabled using the GUI
without compromising on the ability to develop applications.

In fact this application significantlly reduces the RAM consumed in the
default case becasue the Self Test app does not need to maintain its
state.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-01-03 14:54:34 +00:00
Daniel Thompson
0ab34249fa apps: settings: Use theme colours for text labels
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-01-03 14:47:23 +00:00
Daniel Thompson
8ed2537062 apps: launcher: Use theme colours for text labels
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-01-03 14:46:58 +00:00
Daniel Thompson
93cd03219e apps: heart: Use theme colours for text labels
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-01-03 14:46:47 +00:00
Daniel Thompson
71069e0170 apps: calc: Use the UI colours to generate a background
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-31 19:26:34 +00:00
Daniel Thompson
ad9714b0dc manager: Recategorize the theme labels for apps
By default bright and mid are white/grey tones, the ui widgets are
blue and the spot colours are different variants of orange.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-31 19:22:54 +00:00
Daniel Thompson
bb1bee8feb apps: steps: Fix typo in docstrings
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-12-30 10:29:37 +00:00