Mercurial > louis > kiibohd-controller
comparison Macro/PartialMap/macro.c @ 380:5f085e29a66c
Fix Latching bug (introduced when fixing shift and lock recently)
- Also conditionally refresh the lcd screen if enabled /w interconnect
(Not the ideal way to update, but the only way with the current KLL version)
author | Jacob Alexander <haata@kiibohd.com> |
---|---|
date | Sun, 04 Oct 2015 16:19:20 -0700 |
parents | dbbdedccc275 |
children | d8f61e15aca1 |
comparison
equal
deleted
inserted
replaced
379:a113d416950e | 380:5f085e29a66c |
---|---|
420 | 420 |
421 // Lookup map, then layer | 421 // Lookup map, then layer |
422 nat_ptr_t **map = (nat_ptr_t**)LayerIndex[ cachedLayer ].triggerMap; | 422 nat_ptr_t **map = (nat_ptr_t**)LayerIndex[ cachedLayer ].triggerMap; |
423 const Layer *layer = &LayerIndex[ cachedLayer ]; | 423 const Layer *layer = &LayerIndex[ cachedLayer ]; |
424 | 424 |
425 return map[ scanCode - layer->first ]; | 425 // Cache trigger list before attempting to expire latch |
426 nat_ptr_t *trigger_list = map[ scanCode - layer->first ]; | |
427 | |
428 // Check if latch has been pressed for this layer | |
429 uint8_t latch = LayerState[ cachedLayer ] & 0x02; | |
430 if ( latch && latch_expire ) | |
431 { | |
432 Macro_layerState( 0, 0, cachedLayer, 0x02 ); | |
433 #if defined(ConnectEnabled_define) && defined(LCDEnabled_define) | |
434 // Evaluate the layerStack capability if available (LCD + Interconnect) | |
435 extern void LCD_layerStack_capability( uint8_t state, uint8_t stateType, uint8_t *args ); | |
436 LCD_layerStack_capability( 0, 0, 0 ); | |
437 #endif | |
438 } | |
439 | |
440 return trigger_list; | |
426 } | 441 } |
427 | 442 |
428 // If no trigger macro is defined at the given layer, fallthrough to the next layer | 443 // If no trigger macro is defined at the given layer, fallthrough to the next layer |
429 for ( uint16_t layerIndex = macroLayerIndexStackSize; layerIndex != 0xFFFF; layerIndex-- ) | 444 for ( uint16_t layerIndex = macroLayerIndexStackSize; layerIndex != 0xFFFF; layerIndex-- ) |
430 { | 445 { |