comparison Macro/PartialMap/macro.c @ 371:23104e8e24f4

Fixing layer stack evaluation - Layers were stacked correctly, but evaluated backwards
author Jacob Alexander <haata@kiibohd.com>
date Fri, 21 Aug 2015 20:33:47 -0700
parents 5aa3f6a92682
children dbbdedccc275
comparison
equal deleted inserted replaced
370:39e338a6733d 371:23104e8e24f4
372 372
373 return map[ scanCode - layer->first ]; 373 return map[ scanCode - layer->first ];
374 } 374 }
375 375
376 // If no trigger macro is defined at the given layer, fallthrough to the next layer 376 // If no trigger macro is defined at the given layer, fallthrough to the next layer
377 for ( uint16_t layerIndex = 0; layerIndex < macroLayerIndexStackSize; layerIndex++ ) 377 for ( uint16_t layerIndex = macroLayerIndexStackSize; layerIndex != 0xFFFF; layerIndex-- )
378 { 378 {
379 // Lookup Layer 379 // Lookup Layer
380 const Layer *layer = &LayerIndex[ macroLayerIndexStack[ layerIndex ] ]; 380 const Layer *layer = &LayerIndex[ macroLayerIndexStack[ layerIndex ] ];
381 381
382 // Check if latch has been pressed for this layer 382 // Check if latch has been pressed for this layer