1
0
Fork 0
Commit graph

217 commits

Author SHA1 Message Date
Daniel Thompson
bfa715b488 widgets: clock: Improve the redraw logic
Currently if we wake the watch exactly N hours (where N is integer)
after it goes to sleep then the time will not be updated. Fix this the
obvious way.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-11-22 09:27:14 +00:00
Daniel Thompson
748e5fe65a docs: Wordsmtithing updates after review
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-11-22 09:25:24 +00:00
Daniel Thompson
6f0238415f apps: music: Add to application index
Additionally we rename the screenshot to conform to the naming
convention (app.NAME + 'App.png') used for simulator screenshots.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-11-22 09:22:50 +00:00
Daniel Thompson
fd0e0d77aa [pinetime,p8,k9]: Show when main.py is running
This is yet another step towards making the role of main.py more obvious.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-11-14 20:40:16 +00:00
Daniel Thompson
e105c8bb68 apps: testapp: Add an alarm test
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-11-14 20:36:41 +00:00
Daniel Thompson
dd5a1e75af apps: steps: Use the alarm system to reset the step counter at midnight
This is way better than zeroing it the first time in the day we use the
step counter!

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-11-14 12:25:32 +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
3d0d96ee3a icons: Optimize flash size of the music player icons
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-11-12 21:47:38 +00:00
Daniel Thompson
5796a0c113 apps: music: Fix double track name bug
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-11-12 21:47:38 +00:00
Carlosgg
306a1ec0a4 apps: Add music player app with GadgetBridge support
Signed-off-by: Carlos Gil <carlosgilglez@gmail.com>
[daniel@redfelineninja.org.uk: fix regressions on simulator, disable by
default (for now) on real hardware and remove a couple of whitespace
changes to existing files]
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-11-12 21:44:22 +00:00
Daniel Thompson
294797d826 hrs3300: Defer initialization until the HRS is used
This means hardware failure won't cause the initial boot to fail. This
won't stop the heart rate app from crashing when it starts up but at
least it will give a comprehensible crash report.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-11-11 22:07:21 +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
8e89e38175 manager: Introduce shared "system bar"
Providing a status bar for all apps to use allows us to reduce allocations
within the applications.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-11-04 19:00:37 +00:00
Daniel Thompson
f95f45cda3 apps: fibonacci clock: Updates to structure like clock app
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-10-25 08:55:58 +00:00
Daniel Thompson
1b99764e8d apps: clock: Simplify and increase commenting
The main simplification is to adopt the status bar (with the status bar
clock disabled) and to restructure the way draw and redraw are handled.
Since the clock application is one of the most popular to customize it
has also had extensive commenting added to describe how it works.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-10-25 08:55:20 +00:00
Daniel Thompson
37f8a47220 apps: steps: Switch over the status bar widget
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-10-21 21:29:15 +01:00
Daniel Thompson
fd4017c729 apps: stopwatch: Switch over the status bar widget
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-10-21 21:28:49 +01:00
Daniel Thompson
398ce598fc widgets: status: Add a status bar combo widget
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-10-21 21:28:09 +01:00
Daniel Thompson
9f3c75d512 widgets: battery: Fix a redraw bug
Currently if the real battery level is <5% then a redraw from scratch will
not draw the outline of the battery. Fix this by adding a special case for
negative previous states (-1 charging, -2 redraw).

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-10-21 21:10:16 +01:00
Daniel Thompson
6cd1e86295 widgets: clock: Add a simple clock widget
This is intended to be reused by any app that shows the clock as part
of the status bar at the top of the display.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-10-21 21:10:16 +01:00
Daniel Thompson
fc502cdcaa widgets: Rename StatusBar to NotificaitonBar
This is not (yet) a useful change but we'll be creating a new StatusBar
soon.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-10-20 18:56:08 +01:00
Daniel Thompson
52de478682 apps: fibonacci_clock: Nudge the clock down a few pixels
The better manages the space between the battery meter and the clock.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-10-10 21:42:51 +01:00
Daniel Thompson
a5f69ffe26 apps: fibonacci_clock: Enable status bar for notifications
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-10-10 21:42:51 +01:00
Daniel Thompson
89d91f7e5b widgets: Fix a broken docstring
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-10-10 21:42:51 +01:00
Daniel Thompson
aef95e6d80 apps: fibonacci_clock: Add an simple icon
For some users the icon is pointless because they would rather install
the clock on the quick ring but this clock is something of a novelty so
it would be quite reasonable to only launch it when in the mood for
decoding something!

Happily the icon compresses nicely too!

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-10-10 14:06:44 +01:00
Daniel Thompson
c1c66fb487 boards: Introduce a shared manifest for all 240x240 devices
This also adds the Fibonaci Clock, Haiku viewer and the Game of Life
to the manifest. They are *not* registered by default at this point
since, although we can currently spare the internal flash space there
is more competition for RAM so we have to trade off out-of-the-box
convenience with keeping as much RAM as possible for users to do
"cool things".

Given the zen of wasp-os is to try to make is as easy as possible for
users to become coders we currently favour reserving the space for the
cool things (and implicitly encouraging them to write a couple of lines
of python to enable the bonus applications.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-10-10 14:04:44 +01:00
Johannes Wache
4942e3e935 apps: fibonacci_clock: Add a Fibonacci clock application
Signed-off-by: Johannes Wache <jbwa@posteo.de>
[daniel@redfelineninja.org.uk: Tidy up the "git soup", dropped the manifest
changes and integrated the description from the original PR into the
docstring for the app]
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-10-10 13:12:39 +01:00
Daniel Thompson
11640d8362 apps: haiku: Add a simple Haiku viewer
This app serves as an example of using the filesystem to make an
application more flexible. Both the verses and the icon will be
loaded from the filesystem rather than being burned into the
wasp-os binaries.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-10-10 12:12:59 +01:00
Daniel Thompson
6e91e0e414 drivers: flash: Automatic wake/sleep to minimise idle current
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-10-10 11:45:25 +01:00
Daniel Thompson
b9daf05fbc boards: pinetime: Don't add nor_cs to the namespace
Having an extra identifier for the Pin() is a waste of RAM... if you need
the CS pin then grab it from watch.flash._cspins instead.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-10-10 11:30:32 +01:00
Daniel Thompson
942e9f0bb4 apps: pager: Avoid crashes for notifications with no body
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-10-10 11:28:25 +01:00
Jeffrey Bailey
f924bb6414 boards: Remove flash wake up commands
Wake from deep power down is now handled in the driver. Remove attempt
to wake the board files.

Signed-off-by: Jeffrey Bailey <wb.jeffrey@gmail.com>
[daniel@redfelineninja.org.uk: Update commit message, simplify
slightly, extended to all boards with spinor flash and update
gitmodules to bring in the flash driver updates.]
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-09-27 14:26:29 +01:00
Daniel Thompson
7075f5689e wasp: Fix broken indention
Currently the simulator cannot run correctly because the indentation
in Manager.__init__ mixes tab and spaces. This is something CPython3
doesn't like but MicroPython is ok about.

Fix the obvious by using correct indentation.

Fixes: 889115f ("wasp: Allow app initialization to fail")
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-09-22 21:14:45 +01:00
Daniel Thompson
6bf350a6e9 drivers: cst816s: Clear the event buffer during a wake up
Currently with CST816S controllers (but not CST716S controllers) then a
swipe delivered whilst the device is asleep will sometimes be processed
after we wake it up. That's never likely to be useful. Fix this by
explicitly clearing the event buffer as part of the wakeup sequence.

Reported-by: Siroj42 <siroj42@users.noreply.github.com>
Fixes: #65
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-09-21 20:12:38 +01:00
Daniel Thompson
889115f4b0 wasp: Allow app initialization to fail
Colmi has released a new revision of the P8 hardware based on a different
accelerometer. That makes it impossible for the StepCounterApp to
initialize and currently this takes down the whole GUI due to the
uncaught exception.

Fix this by skipping applications that will not initialize.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-09-16 21:47:22 +01: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
9877ea99bd README: Add a (fairly) comprehensive screenshot tour
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-08-16 18:48:15 +01:00
Daniel Thompson
cd97893d2c apps: stopwatch: Add NEXT support
On a device with NEXT support we need to make sure we reset the stopwatch
when switching away from it (if it is not running) since there may not
be any other way to reset it.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-08-15 20:43:22 +01:00
Daniel Thompson
44ba8ebd22 drivers: cst816s: Handle a failure to sleep
Exceptions on th sleep path more or less kill the device (it is half
alseep and is not on... but not off enough for the power button to work.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-08-15 20:40:26 +01:00
Daniel Thompson
34ca73ee60 gadgetbridge: Disable the not-implemented message
Currently the not-implemented message provokes GadgetBridget into
issuing lots of annoying toaster messages. It's still useful for debugging
but let's disable it by default.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-08-15 20:37:52 +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
a87b3faa4a k9: Disable safe-mode
Currently the K9 is wedged in safe-mode. Oops! Fix this.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-08-15 16:56:28 +01:00
Daniel Thompson
d535b8b16c k9: watch.py.in: Fix backlight
Currently the backlight is permanently on at its lowest level. The
backlight is so dim that this is almost impossible to detect. I only
found it when lying in a field in total darkness and observing that the
screen wasn't quite as black as I expected.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-08-15 16:55:56 +01:00
Daniel Thompson
a47e0921b3
Merge pull request #48 from Siroj42/master
Fix background color of strings.
2020-08-09 21:23:39 +01:00
Daniel Thompson
2d1942f76a k9: Add support for Senbono K9
The K9 is similar to the PineTime and P8 devices but does not appear
to use the CST[78]16 touch screen controllers. At present the protocol
is not known (readfrom yields all zeros, readfrom_mem provokes an
exception) so we have a hugely limited interface consisting of the side
button and the touchscreen interrupts (in other words we can treat the
touchscreen like a second button).

Works suprisingly well considering...

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-08-09 20:06:45 +01:00
Siroj42
cc34c5d46d draw565: Fix wrong background color of strings
Signed-off-by: Joris Warmbier <siroj42@t-online.de>
2020-08-02 21:55:04 +02:00
Daniel Thompson
13b35611e2 boards: p8: Full support for Colmi P8
All the components (bootloader, reloader, micropython) has P8 support added
some time back but without full integration at the wasp-os level. Let's
add it!

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
2020-07-27 22:15:42 +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
a01fb7df57 Introduction basic notification support
This requires a modified version of Gadgetbridge and currently works by
implementing the BangleJS protocol.

In Gadgetbridge ensure "Sync time" is *not* set and choose "Don't pair"
when adding the PineTime device.
2020-07-19 20:50:33 +01:00