1
0
Fork 0
Commit graph

638 commits

Author SHA1 Message Date
Daniel Thompson
04e35d437e wasptool: Make mem_free issue data as csv
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-07-25 09:42:26 +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
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
586507753b wasp: Manager: Fix the capture of the post-init free RAM
Fixes: b59a5b1d37 ("wasp: Manager: Rewrite the startup logic")
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-06-21 21:41:51 +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
e169dbf61a drivers: cst816s: Add a version() method
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-06-20 17:26:32 +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
ae0d59dbe3 widgets: Further compact some of the internal representations
Many widgets adopted the _im(mutable) idiom to allow us to reduce the
RAM overhead of each widget. Where the immutable data considers entirely
of integers smaller than 256 then we can push this just a little further
by switching from a tuple to a bytes.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-06-20 17:08:39 +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
29d619aebc tools: Update nrfutil for click 8.x compatibility
Tested on Debian bullseye using wasp/requirements.txt in order to get
the latest version of click.

Fixes: #211
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-06-20 15:19:24 +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
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
Daniel Thompson
3ea061508f icons: Introduce new clock icon
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-06-20 10:18:58 +01:00
Daniel Thompson
c373bc4d77 rle_encode: Include the image size in the comments
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-06-20 10:18:27 +01:00
Daniel Thompson
ab84121d62 gitignore: Add a couple of extra temporary file types to the ignore list
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-06-20 09:28:35 +01:00
Daniel Thompson
f221e2f8a4 rtc: Undo the once-per-second wake up
So... waking up once per second turns out to be a dumb idea because it
regresses the stop watch and HRS tools (which now also only wake up once
per second).

Undo this change but sprinkle a few more micropython.native decorations
on methods used on the wakeup path to minimise power.

Fixes: fb18705b9b ("manager/rtc: Experimental power saving technique")
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-06-19 08:22:20 +01:00
Daniel Thompson
33ff7dc91e drivers: nrf_rtc: Fix sphinx build
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-06-18 21:43:47 +01:00
Daniel Thompson
4587a0ac33 README: Move wasp-os community chat to libera.chat
We also update the recommendation for those new to IRC to use
a matrix/IRC bridge instead of a simple IRC web client since that
should make the community a bit more interactive.

If you are curious about the move to libera.chat take a look at
the Linux Weekly News summary of the beginning of the end
(https://lwn.net/Articles/857140/ ) together with these
testimonials about the behaviour of the new freenode staff
which I think makes clear we have reached the end of the end:

 * https://nedbatchelder.com/blog/202106/goodbye_freenode.html
 * https://www.fsf.org/news/update-to-the-fsf-and-gnus-plan-to-move-irc-channels-to-libera.chat
 * https://twitter.com/irccloud/status/1404153550159159298

So... we're moving... and sorry for not making this decision sooner!

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-06-18 20:24:18 +01:00
Daniel Thompson
fb18705b9b manager/rtc: Experimental power saving technique
Currently the time is calculated 8 times per second from (relatively) slow
python code. Optimize the power consumed by reducing the number of times
we check for wall time updates to only once-per-second and use native
code generation to reduce VM overhead when executing this critical code.

At the time of writing the difference is battery life has not yet been
measured (but we know the current master branch is worse than v0.4 and,
in theory at least, this should close the gap).

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-06-04 10:49:33 +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
1115ac2fff MemoryError exception now shows custom message instead of CrashApp.
Signed-off-by: Tait Berlette <54515877+taitberlette@users.noreply.github.com>
2021-06-03 21:45:24 +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
e76a4afd85 manager: Improve application registration
When an application is registered using a string that gives the class
name (e.g.  "apps.chrono.ChronoApp") when we automatically delete
the module from a couple of namespaces. This ensures the garbage
collector can do a deeper clean when the application is unregistered.

We also provide a means to directly register watch faces (e.g. to
replace the default clock).

Fixes: #214
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-06-03 19:57:09 +01:00
Daniel Thompson
0d385b8dc5 Makefile: Create .zip distributions as well as a tarball
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-06-03 19:56:28 +01:00
Daniel Thompson
06e3f05ef9 reloader: Update to newer factory firmware for pinetime
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-06-03 17:09:32 +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
3bbd808115 wasptool: Fix progress bar numbering
Currently direct callers of draw_pbar() can have 20 or more digits after
the decimal place. Fix this by moving the rounding function.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-05-05 21:02:16 +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
Daniel Thompson
58b5c0378e draw565: Optimize the string drawing
Currently there is a redundant fill operation issued for every character
drawn. This was added to draw the background colours correctly but the
change did not account for the optimized character rendering in
_draw_glyph().

This results in ~15% performance improvement for character rendering

Fixes: cc34c5d46d ("draw565: Fix wrong background color of strings")
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-03-29 22:16:43 +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
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
thefenriswolf
d966c960c1 wasptool: add --battery to check battery level
Signed-off-by: thefenriswolf <stefan.rohrbacher97@gmail.com>
2021-03-27 09:03:14 +00:00
Daniel Thompson
402801c538 draw565: Avoid over-long lines when handling space
Currently, if the line wrapper attempts to break a line on a space and
that space character is outside the bounding box, then we generate an
over-long line.

Fix this by handling line break generation *after* we have checked the
length of the current line.

Fixes: #193
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-03-22 08:29:06 +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
16a9253938 apps: WordClock: Update screenshot
Update the screenshot with one that reflects the updated usage
of Capital letters.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-03-10 21:37:36 +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
Brendan M. Sleight
867ed324b5 Update requirements.txt
Signed-off-by: Brendan M. Sleight <bms.git@barwap.com>
2021-03-09 21:15:02 +00:00
Lyz
c09a42ca4d style: fix typo in README
Signed-off-by: Lyz <lyz@riseup.net>
2021-03-09 21:08:57 +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
72f5322cc3 steplogger: Write less frequently
Currently we dump the step data every 30 minutes. This was a good
interval for testing but we can extend it a little without any
problems.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-02-25 07:49:23 +00:00
Daniel Thompson
affa101169 steplogger: Ensure today's data is updated when we provide it
Currently steps from the last six minutes do not appear in the data. We
can fix this by updating the data before creating the iterator.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-02-25 07:45:53 +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
cabe6f143c tools: wasptool: Fix binary downloads for a specific special case
Currently if the binary file being downloaded contains single quote
characters then it gets wrapped differently by repr() so we have to add
additional cases to strip the wrapper.

Fix this the "obvious" way... where by "obvious" I mean almost anything
but.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-02-25 07:25:32 +00:00
Daniel Thompson
181aad6666 steplogger: Add iterator to allow UI to read the data
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-02-21 21:24:24 +00:00