1
0
Fork 0
Commit graph

193 commits

Author SHA1 Message Date
Daniel Thompson
d62e6a22c7 Fix symbol lookup error (knob2) 2020-06-04 22:57:50 +01:00
Daniel Thompson
4c7e92d964 apps: settings: Adopt the slider... it looks more interesting 2020-05-24 14:20:20 +01:00
Daniel Thompson
de647b324c widgets: Introduce a slider widget
Currently the slider doesn't actually slide (because we process touch
events rather than swipe events) but we've called is a slider anyway.
2020-05-24 14:20:02 +01:00
Daniel Thompson
57999226fd draw565: rle2bit: Add support for palette overrides
This allows some interesting manipulations of 2-bit images.
2020-05-24 14:19:04 +01:00
Daniel Thompson
60bb43e87b apps: gameoflife: Better pixel colour selection 2020-05-18 22:19:19 +01:00
Daniel Thompson
7f6b1b9059 draw565: Switch to a different palette for RLE 2-bit images
This is an incompatible change... older 2-bit images will need to be
re-encoded to display correctly.
2020-05-18 22:17:51 +01:00
Daniel Thompson
d9bdb0c82f boards: Remove demo.py from the manifests
Fixes: #25
2020-05-18 08:12:00 +01:00
Daniel Thompson
b9e82424e9 apps: demo: Move the logo into the demo app
The logo module is currently unused but it simply sits there consuming
flash. Let's shift it to the demo app to is can consume RAM instead (but
only when we upload the demo to the watch).
2020-05-17 14:37:44 +01:00
Daniel Thompson
ac1a799bfa draw565: Fix line optimization code
sx is measured in pixels (2-bytes) and len(display.linebuffer) gives
a value in bytes so the divisor isn't right.

Whilst we are here let's make sure we use integer division too.

Fixes: #18
2020-05-17 09:47:15 +01:00
Daniel Thompson
4906d46ff4 apps: demo: Move the demo code into a fully fledged application 2020-05-17 09:45:16 +01:00
Daniel Thompson
e391480b50 wasp: watch: docstrings for the watch namespace 2020-05-14 23:22:57 +01:00
Daniel Thompson
d11e6eb4a1 Make wasp-os namig consistant
Rename WASP to wasp-os (or Wasp-os)
2020-05-14 22:41:05 +01:00
Daniel Thompson
b8efcd3053 wasp: Even more docstrings 2020-05-14 22:29:35 +01:00
Daniel Thompson
f07fb6d22a wasp: draw565: docstrings for headings and __init__ 2020-05-14 21:44:05 +01:00
Daniel Thompson
42fe7bf352 drivers: vibrator: Finalize docstrings 2020-05-14 21:42:16 +01:00
Daniel Thompson
95f1788347 drivers: st7789: Finalize docstrings 2020-05-14 21:41:02 +01:00
Daniel Thompson
9274d8cc2d drivers: signal: Finalize docstrings 2020-05-14 21:39:14 +01:00
Daniel Thompson
880083977c drivers: nrf_rtc: Finalize docstrings 2020-05-14 21:36:33 +01:00
Daniel Thompson
d5c629a9ac drivers: cst816s: Finalize docstrings 2020-05-14 21:36:09 +01:00
Daniel Thompson
85079c149b drivers: battery: Finalize docstrings 2020-05-14 21:32:01 +01:00
Daniel Thompson
93ad0e6972 wasp: draw565: docstring improvements 2020-05-11 23:07:35 +01:00
Daniel Thompson
a2fd52ef2b docs: Introduce the Application Writer's Guide. 2020-05-11 21:44:30 +01:00
Daniel Thompson
fe1bbbac52 apps: template: Fix broken docstring 2020-05-10 09:34:57 +01:00
Daniel Thompson
09071427e4 drivers: nrf_rtc: Fix some tab/space issues
These issues do not appear when parsing with micropython but when we
import this file into sphinx then things go a bit south.
2020-05-10 09:34:22 +01:00
Daniel Thompson
a4c62bb818 wasp: apps: Remove __init__.py
wasp-os contains circular import dependancies (wasp includes apps which
include wasp) but this is normally harmless.

However using __init__.py exagerated to the problem and since the benefit
of the __init__ file is pretty anyway the let's just remove it.
2020-05-10 09:33:26 +01:00
Daniel Thompson
c1f8823f61 Add PNVRAM support to avoid forgetting the time during a reboot. 2020-05-09 14:19:10 +01:00
Daniel Thompson
2d437b0f68 wasp: drivers: nrf_rtc: Fix a nasty bug when setting the time
The code to recalculate the uptime to walltime adjustment was broken
(e.g. the longer we leave it after reboot the more inaccurate the time
setting becomes).

Fixes: 80079e4 ("wasp: nrf_rtc: Add a tiny bit of extra resolution")
2020-04-26 15:01:48 +01:00
Daniel Thompson
6729ac67a5 apps: launcher: Add a scroll ready indicator 2020-04-26 15:01:48 +01:00
Daniel Thompson
8b2ba4e79c apps: launcher: Make app.ICON optional 2020-04-26 15:01:48 +01:00
Daniel Thompson
e854998268 apps: stopwatch: Fix redraw bug (and remove some old test code) 2020-04-26 15:01:48 +01:00
Daniel Thompson
9348e758b2 wasp: nrf_rtc: Add a tiny bit of extra resolution
We now have a couple of applications (stopwatch, Game of Life) that benefit
from sub-second precision. The micropython RTC/utime code for nrf still
needs a major overhaul but this allows us to paper over the cracks for
just a little longer.
2020-04-26 15:01:48 +01:00
Daniel Thompson
5b277e94f1 wasp: Manager: Avoid printing the stack trace when it can cause problems
On nRF devices if we print with the NUS console disconnected (instead
of never connected) then things we can end up hanging. Better only
to print an exception if the watch class contains a method to do
that.
2020-04-26 15:01:48 +01:00
Daniel Thompson
880764da7d wasp: apps: Conway's Game of Life 2020-04-18 11:54:03 +01:00
Daniel Thompson
bfd914a5d1 boards: simulator: Add ptr32 support 2020-04-17 17:19:11 +01:00
Daniel Thompson
66743d42c8 wasp: Manager: Bring in proper separation of apps
This is getting us much closer to the final UI concept. We have a
quick ring from which we can select typical apps such as clock and
stopwatch which will (eventually) be supplemented with step counting
and heart rate monitoriing. More exotic apps (currenrtly torch, self
test, settings) are all relagated to the launcher ring.
2020-04-14 20:05:57 +01:00
Daniel Thompson
10706a9704 wasp: stopwatch: Replace the stub with a "real" implementation
There are still some holes here. In particular the RTC resolution on
nRF devices (such as PineTime) is currently a full second (meaning
the centiseconds will always be zero. Nevertheless that isn't the apps
fault... as we can see when we run on the simulator.
2020-04-14 20:03:04 +01:00
Daniel Thompson
5fc802fb78 wasp: Manager: Push exceptions to the console as well as the crash app 2020-04-14 20:00:49 +01:00
Daniel Thompson
a77301ec64 fonts: Add sans36 (numerals only)
At 36pt this is already gobbling a fair bit of flash so, for now, we've
restricted this only numerals (and colon).
2020-04-14 20:00:04 +01:00
Daniel Thompson
64afea0d07 WIP: Introduce the quick_ring 2020-04-12 08:59:37 +01:00
Daniel Thompson
b649cd1b24 wasp: template: Implement optional application methods 2020-04-12 08:41:31 +01:00
Daniel Thompson
80d518b75b wasp: apps: Add shortcuts to all apps 2020-04-12 08:40:49 +01:00
Daniel Thompson
64a97fce58 wasp: testapp: Sort tests alphabetically 2020-04-12 08:40:11 +01:00
Daniel Thompson
50ecff29ef wasp: Automatically generate watch.py for PineTime
This should ensure that main.py is always up to date.
2020-04-11 21:12:18 +01:00
Daniel Thompson
4c09add2d8 docs: Add text descriptions of icons
Having the raw hex strings makes the docs look really unclean. Fix this
by providing a special version of icons for the "sphinx" board.
2020-04-11 20:49:06 +01:00
Daniel Thompson
683c3497e0 docs: Fix warnings and add a few extra apps to the docs 2020-04-11 20:26:12 +01:00
Daniel Thompson
af1379806c wasp: simulator: Use Tab to replicate the physical button 2020-04-11 20:15:20 +01:00
Daniel Thompson
f68eb610c5 wasp: On-device crash reporting
If an application crashes let's report it on the device so it can be
distinguished from a hang (if nothing else it should mean we get better
bug reports).
2020-04-11 20:15:02 +01:00
Daniel Thompson
23368a659b wasp: apps: Add a new (super simple) settings app 2020-04-10 20:30:20 +01:00
Daniel Thompson
f734568ad2 wasp: draw565: Optimize the bit expansion blitter slightly. 2020-04-10 20:23:12 +01:00
Daniel Thompson
22ca8886c2 wasp: draw565: Automatic RLE format conversion
From here we can also bring colour to the launcher!
2020-04-10 20:22:51 +01:00
Daniel Thompson
a1badfd95d wasp: draw565: Fix colors when burst filling a line. 2020-04-10 20:20:01 +01:00
Daniel Thompson
3bcda8d546 Merge branch 'master' of https://github.com/daniel-thompson/wasp-os 2020-04-10 14:32:22 +01:00
Daniel Thompson
74511a1e1c
Merge pull request #7 from salcedo/master
wasp: pinetime: Release SPI NOR from deep power-down
2020-04-10 14:32:14 +01:00
Daniel Thompson
fd64abe882 wasp: draw565: Optimize the 2-bit RLE drawing functions
There's a bunch of different changes here but there are only really three
big wins. The biggest win comes from restructuring the 2-bit RLE decode
loop to avoid the inner function (~20%) but the switch to 16-bit writes in
_fill() and adoption of quick_write (e.g. no CS toggling) are also
note worthy (and about 5% each).
2020-04-08 21:50:42 +01:00
Daniel Thompson
841fbef8a6 wasp: testapp: Add RLE drawing benchmarks. 2020-04-06 22:04:21 +01:00
Daniel Thompson
8ed80eeeba wasp: launcher: Experimental launcher implementation
It is not really the launcher itself that is immature. Rather that the
framework and UI concepts to move between applications isn't complete
yet.
2020-04-06 22:04:21 +01:00
Daniel Thompson
59bb70fa64 wasp: simulator: Optimize the drawing process
This makes per-pixel access more than double the performnace of a regular
pixelview (but at the expense of requiring numpy).
2020-04-06 22:04:21 +01:00
Daniel Thompson
a1a8f3f8a3 wasp: draw565: Add 2-bit RLE decoder 2020-04-06 22:04:21 +01:00
Daniel Thompson
2b5ebcef72 wasp: widgets: Add a scrolling indicator
As we enrich the navigation options we will increasinly need to visualize
between apps where up/down will switch us between rings and there
up/down is needed to scroll through content.
2020-04-06 22:04:21 +01:00
Daniel Thompson
bb4e76d852 wasp: testapp: Add an option to force an exception
We will shortly be adding machinary to handle application errors more
gracefully. This is a useful way to force an application error!
2020-04-06 22:04:20 +01:00
Daniel Thompson
83cc56969e wasp: manager: make sleep() and background() callbacks optional
Making callbacks optional reduces pointless boilerplate in applications.
2020-04-06 22:04:20 +01:00
Daniel Thompson
6a6e393d1f wasp: vibrator: Better default for pulse
These defaults are good for giving quick UI feedback.
2020-04-06 22:04:20 +01:00
Daniel Thompson
b5e69aead3 wasp: Manager: Parameterize the keep awake timer
This might be a reasonable preference for the setings but, more importantly,
we can also set blank_after to very high values to ensure the watch doesn't
sleep during the voice over in videos!
2020-04-06 22:04:20 +01:00
Daniel Thompson
8c35282214 wasp: Rename Debounce to PinHandler
Debounce was a lousy name...
2020-04-06 22:04:20 +01:00
Daniel Thompson
40b2482165 wasp: simulator: Swap up/down and left/right
This gives the simulator a more natural feel since the "swipe left" action
usually means "more a screen to the right". This will probably make
testing games impossible but makes it much easier to navigate the menus.
2020-04-06 22:04:20 +01:00
Daniel Thompson
c593e1e9f9 wasp: draw565: Allow the drawing context to be reset
The main reason to reset the drawing context is so that it can be reset
before we call foreground() on an application.
2020-04-06 22:04:20 +01:00
Daniel Thompson
b2622b579d wasp: Add button presses to the event system.
Here the biggest changes are in the test application because we
refactor a number of the tests to make better use of the button.

Although applications may consume button events it does have a
default behavior which is to switch to the default application
(usually the clock).
2020-04-06 22:04:20 +01:00
Daniel Thompson
0cc7987689 apps: Remove unused support for effect animation
After a bit of testing I have not yet come up with a fast, visually
acceptable horizontal animated effect. Instead we simply reply on
screen blanking during the redraw... meaning there is no need for an
effect hint.
2020-04-06 22:04:20 +01:00
Daniel Thompson
d10f3dbc49 wasp: Get the terminology straight
As it turned out Direction was only a Direction because there were things
missing from the enumeration!
2020-04-06 22:04:20 +01:00
Daniel Thompson
0ac2321e82 wasp: Factor out the sleep/wake code
Pulling this out into a method allows it to be called by an application.
2020-04-06 22:04:20 +01:00
Daniel Thompson
afb9bd16b6 wasp: Add support for brightness caching and keep-awake signalling 2020-03-26 22:12:05 +00:00
Daniel Thompson
af33c7d79b wasp: Major documentation string improvements. 2020-03-26 21:46:10 +00:00
Daniel Thompson
a9413db5cf wasp: Move the constants into seperate container classes 2020-03-26 20:42:03 +00:00
Daniel Thompson
b9fe31241c Add licensing information for all wasp-os files. 2020-03-22 15:40:18 +00:00
Daniel Thompson
f8bd1a7461 Rename manager.py and expose its interfaces to all applications
This is a big change that break compatiblity with existing applications
*and* with existing installed versions of main.py.

When upgrading it is import to update main.py:

    ./tools/wasptool --upload wasp/main.py
2020-03-22 12:37:19 +00:00
Brian Salcedo
dcc51cd094 wasp: pinetime: Release SPI NOR from deep power-down 2020-03-15 09:38:47 -04:00
Daniel Thompson
5a234c16ad wasp: Rotate the swipe UI by 90 degrees
This is something of an experiment but now the app roll is traversed using
horizontal swipes and applications should primarily use vertical swipes
to navigate internally. This is mostly because if "feels" better but it
also leaves the vertical scrolling hardware available for use by the
app.
2020-03-13 19:02:29 +00:00
Daniel Thompson
3ded49c5ef fonts: sans24: Minor refactor to reduce memory allocation
This is a useful but modest optimization (maybe 3% in string
rendering.
2020-03-09 21:33:29 +00:00
Daniel Thompson
820764081e drivers: st7789: Automatically park ready for the next call to write data
This makes line-by-line drawing more efficient because don't have to
handle the dc line. The optimization targets font rendering and if good
for slightly less than 10% rendering improvement.
2020-03-09 21:32:34 +00:00
Daniel Thompson
69bc452c65 draw565: Optimize the font rendering
This is a big one... more than 4x increase in font rendering performance!
2020-03-09 21:29:35 +00:00
Daniel Thompson
031d139b7c wasp: draw565: Refactor to allow apps to focus on the drawable. 2020-03-09 00:00:13 +00:00
Daniel Thompson
5413d826d7 wasp: Re-factor how Draw565 is used.
Moving it from applications into the watch is useful for two reasons.
Firstly it means applications don't need to know as much about the
display color depth and secondly it makes it easier to replace the
drawing routines with wasptool.
2020-03-08 23:16:30 +00:00
Daniel Thompson
24438ad05d testapp: Smoother transitions between tests 2020-03-08 21:31:17 +00:00
Daniel Thompson
d236db68dc testapp: Show the render time for the string test 2020-03-08 21:22:54 +00:00
Daniel Thompson
cfffeddd77 wasp: testapp: Extend with a string render test 2020-03-08 20:48:48 +00:00
Daniel Thompson
a864a93706 wasp: manager: Blankt the display during app transitions 2020-03-08 20:47:19 +00:00
Daniel Thompson
adf9a33c9e drivers: cst816s: Minor tweaks to the generated documentation. 2020-03-08 17:40:54 +00:00
Daniel Thompson
d2058fb87f docs: Increase the scope of the documentation
We now generate documentation for everything included in the PineTime
manifest (although, at this stage, not everything in the manifest has
all the required docstrings).
2020-03-08 17:40:27 +00:00
Daniel Thompson
799a66c9b9 wasp: Move the apps into their own directory. 2020-03-08 17:39:39 +00:00
Daniel Thompson
b5b96bd776 wasp: Integrate the touch driver
At this point we are starting to bring an event model for applications
but there's still a long way to go!
2020-03-08 10:18:08 +00:00
Daniel Thompson
138425f4d4 wasp: manager: Start refining the application interface
This is the first step in starting to formalize the seperation of
applications from the system manager.
2020-03-07 11:52:42 +00:00
Daniel Thompson
1ebafc083b wasp: simulator: Add CST816S simulation 2020-03-07 11:50:26 +00:00
Daniel Thompson
9664c394a6 drivers: nrf_rtc: Add a higher res monotonic timer 2020-03-07 11:49:35 +00:00
Daniel Thompson
1b334f7ad9 wasp: pinetime: Enable the cst816s by default 2020-03-07 11:48:17 +00:00
Daniel Thompson
e5f455b5ba drivers: cst816s: Decouple from the watch module 2020-03-07 11:47:25 +00:00
Daniel Thompson
948454a33b wasp: cst816s: Initial PoC driver 2020-03-06 21:09:43 +00:00
Daniel Thompson
7fc4592383 wasp: draw565: Add some docstrings 2020-02-23 20:52:09 +00:00
Daniel Thompson
c3d4ddafbc wasp: clock: Add some docstrings 2020-02-23 20:51:58 +00:00
Daniel Thompson
5c0d86d938 docs: Fix some errors in the sphinx board 2020-02-23 20:51:26 +00:00
Daniel Thompson
41647556c1 clock: Reduce the update rate of the battery meter
In addition to the fix (which is simple) we also modify the button handling
of the simulator because, rather by acident, it relies on the bugs in the
battery meter redraw to ensure the simulator stays active.
2020-02-23 20:19:37 +00:00