Merge pull request #523 from keyboardio/EEPROMSettings/default_layer-fix

EEPROM-Settings: Fix default_layer(255)
pull/527/head
Jesse Vincent 6 years ago committed by GitHub
commit 842afd6616
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -50,12 +50,13 @@ uint16_t EEPROMSettings::crc(void) {
}
uint8_t EEPROMSettings::default_layer(uint8_t layer) {
if (layer == 0xff)
return settings_.default_layer;
if (settings_.default_layer != layer)
if (layer < layer_count) {
Layer.move(layer);
settings_.default_layer = layer;
settings_.default_layer = layer;
}
if (layer == 0xff) {
settings_.default_layer = layer;
}
update();
return settings_.default_layer;
}

@ -40,7 +40,10 @@ class EEPROMSettings : public kaleidoscope::Plugin {
static uint16_t crc(void);
static uint16_t used(void);
static uint8_t default_layer(uint8_t layer = 0xff);
static uint8_t default_layer(uint8_t layer);
static uint8_t default_layer() {
return settings_.default_layer;
}
private:
static uint16_t next_start_;

Loading…
Cancel
Save