Fix error in storing keys by layer

pull/365/head
James N. V. Cash 7 years ago
parent 480bfbd021
commit 0073be9a74

@ -117,7 +117,6 @@ bool EEPROMKeymap::focusKeymapLayer(const char *command) {
return false; return false;
} }
uint16_t keysPerLayer = ROWS * COLS; uint16_t keysPerLayer = ROWS * COLS;
uint16_t offset = layer * keysPerLayer;
if (Serial.peek() == '\n') { if (Serial.peek() == '\n') {
for (uint8_t row = 0; row < ROWS; row++) { for (uint8_t row = 0; row < ROWS; row++) {
for (uint8_t col = 0; col < COLS; col++) { for (uint8_t col = 0; col < COLS; col++) {
@ -127,8 +126,9 @@ bool EEPROMKeymap::focusKeymapLayer(const char *command) {
} }
} }
} else { } else {
uint16_t offset = layer * keysPerLayer;
for (uint16_t k = 0; (k < keysPerLayer) && (Serial.peek() != '\n'); k++) { for (uint16_t k = 0; (k < keysPerLayer) && (Serial.peek() != '\n'); k++) {
updateKey(layer + k, parseKey()); updateKey(offset + k, parseKey());
} }
} }

Loading…
Cancel
Save