From: Jacob Alexander Date: Wed, 15 Oct 2014 17:39:39 +0000 (-0700) Subject: Fixing bug that locks up the keyboard if shifting to a layer that doesn't exist. X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;ds=sidebyside;h=f2c3cc0082cf2487589b7517e60e45684c798a01;p=kiibohd-controller.git Fixing bug that locks up the keyboard if shifting to a layer that doesn't exist. --- diff --git a/Macro/PartialMap/macro.c b/Macro/PartialMap/macro.c index 5cca4d3..9119837 100644 --- a/Macro/PartialMap/macro.c +++ b/Macro/PartialMap/macro.c @@ -150,6 +150,10 @@ uint16_t macroResultMacroPendingListSize = 0; // Sets the given layer with the specified layerState void Macro_layerState( uint8_t state, uint8_t stateType, uint16_t layer, uint8_t layerState ) { + // Ignore if layer does not exist + if ( layer >= LayerNum ) + return; + // Is layer in the LayerIndexStack? uint8_t inLayerIndexStack = 0; uint16_t stackItem = 0;