Browse Source

Merge pull request #156 from ntietz/master

Added logic to avoid layer shifts causing a layer to be stuck on
master
Jacob Alexander 7 years ago
parent
commit
ba3c38bf84
1 changed files with 8 additions and 1 deletions
  1. 8
    1
      Macro/PartialMap/macro.c

+ 8
- 1
Macro/PartialMap/macro.c View File

// 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 );
} }


// 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;
} }