changeset 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 f0d97a9a4c1b
children 20ad0a4d1012
files Macro/PartialMap/macro.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
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;