]> git.donarmstrong.com Git - kiibohd-controller.git/blobdiff - Macro/PartialMap/macro.c
Fixing bug that locks up the keyboard if shifting to a layer that doesn't exist.
[kiibohd-controller.git] / Macro / PartialMap / macro.c
index 5cca4d3987f0b1fc225074a90d52b0809a721483..91198372035019503a8b7466894eac7703f80075 100644 (file)
@@ -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;