Only need keysPerLayer in the updating branch of the conditional

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

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

Loading…
Cancel
Save