From c298d22827a6e90235c0bf0b507f3c6df99118be Mon Sep 17 00:00:00 2001 From: "James N. V. Cash" Date: Mon, 30 Oct 2017 10:42:46 -0400 Subject: [PATCH] Only need keysPerLayer in the updating branch of the conditional --- src/Kaleidoscope/EEPROM-Keymap.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Kaleidoscope/EEPROM-Keymap.cpp b/src/Kaleidoscope/EEPROM-Keymap.cpp index 5a0a6636..a8bd42bf 100644 --- a/src/Kaleidoscope/EEPROM-Keymap.cpp +++ b/src/Kaleidoscope/EEPROM-Keymap.cpp @@ -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());