Archived
1
0

Merge pull request #156 from ntietz/master

Added logic to avoid layer shifts causing a layer to be stuck on
This commit is contained in:
Jacob Alexander 2016-10-10 23:15:13 -07:00 committed by GitHub
commit ba3c38bf84

View File

@ -314,6 +314,14 @@ void Macro_layerShift_capability( uint8_t state, uint8_t stateType, uint8_t *arg
// Cast pointer to uint8_t to uint16_t then access that memory location // Cast pointer to uint8_t to uint16_t then access that memory location
uint16_t layer = *(uint16_t*)(&args[0]); uint16_t layer = *(uint16_t*)(&args[0]);
// Only set the layer if it is disabled
if ( LayerState[ layer ] != 0x00 && state == 0x01 )
return;
// Only unset the layer if it is enabled
if ( LayerState[ layer ] == 0x00 && state == 0x03 )
return;
Macro_layerState( state, stateType, layer, 0x01 ); Macro_layerState( state, stateType, layer, 0x01 );
} }
@ -1356,4 +1364,3 @@ void cliFunc_macroStep( char* args )
// Set the macro step counter, negative int's are cast to uint // Set the macro step counter, negative int's are cast to uint
macroStepCounter = count; macroStepCounter = count;
} }