1
0
Fork 0
Commit graph

711 commits

Author SHA1 Message Date
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
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
bbf7d3aa14 drivers: hrs3300: Reduce HGAIN to x8
Experimentally drop the HGAIN to x8. Currently the evidence base for
this change is a little weak but it doesn't seem to be *worse* than
what we have now. Therefore I hope the wasp-os users will forgive me
for using them as guinea pigs!

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-09-10 21:17:57 +01:00
Daniel Thompson
da71d39aa4 tools: wasptool: Increase OTA reboot timeout
Currently --ota works "most of the time" but occasionally the OTA
fails to start. Let's give the reset an extra second to settle!

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-09-10 21:17:57 +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
Daniel Thompson
2a3ffad07d wasptool: Automatically create directories during upload
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-09-10 21:17:57 +01:00
Daniel Thompson
a7c8939737 docs appguide: Update the section on updating main.py
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-09-05 20:57:24 +01:00
Xander Sanger
fe8f6c799c improve and simplify installation guide
Signed-off-by: Xander Sanger <BlimpLover1000@protonmail.com>
Signed-off-by: Xander Sanger <81831075+BlimpLover1000@users.noreply.github.com>
2021-09-05 20:53:05 +01:00
Daniel Thompson
1696c33b36 bootloader: Provate a gcc-11 related workaround
Currrently, gcc-11 users risk bricking their devices because to the
combination of a new optimization pass and some mistakes in the way
the Nordic Softdevice headers wrap the SD system calls.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-09-05 20:45:36 +01:00
Daniel Thompson
4996769ae9 bma42x: Provide a means to check the chip id
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-08-31 21:53:24 +01: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
Daniel Thompson
10c23b0303 bma42x-upy: Add BMA425 support
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
a28a2cd7f4 tools: hrs2csv: Add a simple parser for hrs.data files
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-08-07 21:13:40 +01:00
Daniel Thompson
15434a3841 micropython: Update to v1.16
Don't forget to run `make submodules`!

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2021-07-28 22:01:31 +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
Andreas Kloeckner
bbadbd34c7 Fix escape sequences in wasptool
Signed-off-by: Andreas Kloeckner <inform@tiker.net>
2021-07-25 09:42:39 +01:00
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