If we're looking up a key from `PROGMEM`, only do that if the layer in question
is smaller than `layer_count`. Doing otherwise would read garbage from `PROGMEM`
in case we try to read from a layer higher than what we have in there. This can
happen if we have more layers in `EEPROM` than in `PROGMEM`.
Signed-off-by: Gergely Nagy <algernon@keyboard.io>
To make it easier to use the plugin, pull in `EEPROMSettings` by default, and
explicitly call its `onSetup` (it is safe to do so), so user sketches don't have
to if they don't use `EEPROMSettings` directly. Also set `Layer.getKey` to
`EEPROMKeymap.getKeyOverride` to provide a sensible default.
Signed-off-by: Gergely Nagy <algernon@keyboard.io>
If `EEPROMSettings.seal()` wasn't explicitly called, seal the layout in
`beforeEachCycle()`. On the flip side, this makes user sketches simpler, because
they don't have to seal explicitly. This is done at the cost of an if check each
cycle.
In the long run, EEPROM layout management will be moving out of this plugin, so
this check will be eventually dropped too.
Signed-off-by: Gergely Nagy <algernon@keyboard.io>
These two lines went in by mistake earlier, they were meant for local
debugging only. As such, having them in the plugin is a bug, easily
squashed by removing them.
Signed-off-by: Csilla Nagyné Martinák <csilla@csillger.hu>
With keyboardio/Kaleidoscope-Build-Tools#2, it is now done by the `travis-test`
target. We still need to install the shellcheck package, however.
Fixes#356.
Signed-off-by: Gergely Nagy <algernon@keyboard.io>
Because HostOS is a dependency of this plugin, we need that pulled in. The
example sketch has that, but the README did not.
Fixes#10.
Signed-off-by: Gergely Nagy <algernon@keyboard.io>
With the Atreus, we have a board that has a different max upload size depending
on what MCU is used. Until we figure out how to properly support that in the CLI
builder, default to using the first value. That's a reasonable approximation in
most cases.
Signed-off-by: Gergely Nagy <algernon@keyboard.io>
Rearranged the columns so we can do some bit shifting and OR-ing magic instead
of manually picking bits from various pins.
Signed-off-by: Gergely Nagy <algernon@keyboard.io>