]> git.donarmstrong.com Git - kiibohd-controller.git/commitdiff
Fixing layer stack evaluation
authorJacob Alexander <haata@kiibohd.com>
Sat, 22 Aug 2015 03:33:47 +0000 (20:33 -0700)
committerJacob Alexander <haata@kiibohd.com>
Sat, 22 Aug 2015 03:33:47 +0000 (20:33 -0700)
- Layers were stacked correctly, but evaluated backwards

Macro/PartialMap/macro.c

index f6c70eda47d838dfaca17dcac01299094fd89c97..7161fbf9e495d92eb9ec5d6c42f50afae355555a 100644 (file)
@@ -374,7 +374,7 @@ nat_ptr_t *Macro_layerLookup( TriggerGuide *guide, uint8_t latch_expire )
        }
 
        // If no trigger macro is defined at the given layer, fallthrough to the next layer
        }
 
        // If no trigger macro is defined at the given layer, fallthrough to the next layer
-       for ( uint16_t layerIndex = 0; layerIndex < macroLayerIndexStackSize; layerIndex++ )
+       for ( uint16_t layerIndex = macroLayerIndexStackSize; layerIndex != 0xFFFF; layerIndex-- )
        {
                // Lookup Layer
                const Layer *layer = &LayerIndex[ macroLayerIndexStack[ layerIndex ] ];
        {
                // Lookup Layer
                const Layer *layer = &LayerIndex[ macroLayerIndexStack[ layerIndex ] ];