This updates the ErgoDox EZ, Splitograhpy, Technomancy Atreus, and Keyboardio
Atreus sketches to include more of the plugins described in
docs/chrysalis-firmware.md.
Signed-off-by: Gergely Nagy <algernon@keyboard.io>
The primary audience of the document are Kaleidoscope maintainers, and it is
mean to describe what should be included in firmware we intend to ship with
Chrysalis, and what kind of defaults to set up for them.
These are guidelines, not strict policy.
Signed-off-by: Gergely Nagy <algernon@keyboard.io>
Also replaced the old astyle `IDENT-OFF`/`INDENT-ON` comment pairs with
`clang-format off`/`clang-format on`, respectively.
No functional changes, just formatting.
Signed-off-by: Gergely Nagy <algernon@keyboard.io>
Replace the example sketch in `examples/` with a Chrysalis-enabled one in the
plugin directory.
The sketch used is the default Technomancy Atreus sketch from:
keyboardio/Chrysalis-Firmware-Bundle@2dc27f9936787d2747797c0d4962e02cadf92724
Signed-off-by: Gergely Nagy <algernon@keyboard.io>
Replace the minimal ErgoDox sketch in `examples/` with a Chrysalis-enabled one
in the plugin directory.
The sketch used is the default ErgoDox EZ sketch copied from:
keyboardio/Chrysalis-Firmware-Bundle@2dc27f9936787d2747797c0d4962e02cadf92724
Signed-off-by: Gergely Nagy <algernon@keyboard.io>
Instead of shipping a very basic example in `examples/`, ship a
Chrysalis-enabled one in the plugin directory.
The sketch is the default Splitography sketch copied from:
keyboardio/Chrysalis-Firmware-Bundle@2dc27f9936787d2747797c0d4962e02cadf92724
Signed-off-by: Gergely Nagy <algernon@keyboard.io>
Instead of shipping a very basic example in
`examples/Devices/Keyboardio/Model01`, ship the actual factory firmware in the
plugin directory.
The factory firmware used was copied from:
keyboardio/Model01-Firmware@9cc38674c04287abb94771a923f96a23eda4bcc0
Signed-off-by: Gergely Nagy <algernon@keyboard.io>
This new plugin lets us store a default palette and colormap in PROGMEM.
Rather than teaching Colormap to pull from either EEPROM or PROGMEM, this
implements an entirely separate plugin, `DefaultColormap`, which is able
to *push* a palette and colormaps into Colormap.
When `DefaultColormap.setup()` is called, it checks if Colormap's storage area
is empty (both palette and the map must be empty), and if so, copies the
built-in palette and colormap over, and forces a refresh, and it has done its
job.
It does provide an additional Focus command too, `colormap.install`, which will
forcibly copy both palette and colormaps over. Useful for resetting back to a
factory setting.
Signed-off-by: Gergely Nagy <algernon@keyboard.io>
To be able to set a theme from the firmware itself, we need a couple of helper
methods. First, we need to be able to update the palette without using Focus,
and we also need to be able to update a single LED without committing it. On top
of that, we'll likely want to know if the theme is initialized.
To this end, we introduce `updatePaletteColor()`, which updates an entry in the
palette, but does not commit it, and `isThemeUninitialized()` which does as the
name suggests: it checks if the palette and the theme slices are all uninitialized.
We also change `updateColorIndexAtPosition()` to not commit. The single user of
it was FingerPainter, and we update that to do an explicit commit after.
Signed-off-by: Gergely Nagy <algernon@keyboard.io>
This test verifies that PrefixLayer doesn't clear held non-modifier keys from
the report before sending the prefix sequence.
Signed-off-by: Michael Richters <gedankenexperimenter@gmail.com>
This new plugin provides a way to set a default (but configurable, via Focus)
led mode, or use a specific one if EEPROM is uninitialized.
Signed-off-by: Gergely Nagy <algernon@keyboard.io>
This basically reverts 07dcf1dc9b, returning the
plugin to its original behaviour of persisting the current led mode. We do this
because we'll be using a new, different plugin to set the default led mode, to
not conflate the two different functionalities.
Signed-off-by: Gergely Nagy <algernon@keyboard.io>
`kaleidoscope::driver::storage::AVREEPROM` wasn't implementing its own
`isSliceUninitialized()` method, and relied on the Base class to do so. However,
since we're not using `virtual` methods, the base class was using
`Base::read()` (which always returns 0) rather than `AVREEPROM::read()`, so
`isSliceUninitialized()` always returned false.
To fix this, we implement the function in `AVREEPROM`, and let the default
implementation in Base always return false.
Signed-off-by: Gergely Nagy <algernon@keyboard.io>
This plugin provides a shared virtual keys array used by Macros and
DynamicMacros, along with some functions to interact with it (`press()`,
`release()`, `tap()`, `clear()`).
Signed-off-by: Michael Richters <gedankenexperimenter@gmail.com>
The plugin was both more complex and less accurate than it could have been. For
simplicity, it used a weighted average, with each cycle getting twice the weight
of the previous one. As a result, the reported average really only took into
account the last three or four cycles. On a keyboard with LEDs, some cycles
take much longer than others because of relatively rare updates, so this could
lead to misleading results, with the "average" cycle time usually being reported
as lower than it really should have been, and occasionally much higher.
This new version computes an evenly-weighted mean cycle time for each interval,
and runs more efficiently, by dividing the total elapsed time by the number of
cycles that has passed since the last report, rather than computing the time for
each individual cycle.
Signed-off-by: Michael Richters <gedankenexperimenter@gmail.com>
We'd like to be able to set the default LED mode via Focus, so it can be
configured via Chrysalis. However, we may not want auto-save, so make that
configurable too.
To preserve the EEPROM layout, the highest bit of the previous led mode index
setting was repurposed for the auto save setting. This lets us set the default
mode to anything between 0 and 126 (or 127, if auto save is turned off).
While there, we also add an `onNameQuery` handler, to make it easier for
Chrysalis to detect if the plugin is available.
This addresses the Kaleidoscope parts of keyboardio/Chrysalis#846.
Signed-off-by: Gergely Nagy <algernon@keyboard.io>