Mercurial > louis > kiibohd-controller
diff Macro/PartialMap/macro.c @ 241:9f62492034c7
Fixing bug that locks up the keyboard if shifting to a layer that doesn't exist.
author | Jacob Alexander <haata@kiibohd.com> |
---|---|
date | Wed, 15 Oct 2014 10:39:39 -0700 |
parents | 2a4c99da1276 |
children | e79f2b9c39cf |
line wrap: on
line diff
--- a/Macro/PartialMap/macro.c Sat Oct 04 14:50:42 2014 -0700 +++ b/Macro/PartialMap/macro.c Wed Oct 15 10:39:39 2014 -0700 @@ -150,6 +150,10 @@ // 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;