From 34cea2623d87bda59e17bdd14265b91be0c6ed19 Mon Sep 17 00:00:00 2001 From: Michael Richters Date: Thu, 30 Nov 2017 01:46:40 -0600 Subject: [PATCH] This iterator should count down, not up --- src/layers.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/layers.cpp b/src/layers.cpp index 64960a4a..9e6643da 100644 --- a/src/layers.cpp +++ b/src/layers.cpp @@ -122,7 +122,7 @@ Layer_::updateActiveLayers(void) { void Layer_::updateHighestLayer(void) { // If layer_count is set, start there, otherwise search from the // highest possible layer for the top active layer - for (int8_t i = (layer_count - 1); i > defaultLayer; i++) { + for (int8_t i = (layer_count - 1); i > defaultLayer; i--) { if (bitRead(LayerState, i)) { highestLayer = i; return;