diff options
author | Olivier <olivier@gid0.org> | 2016-04-17 19:54:06 +0200 |
---|---|---|
committer | Olivier <olivier@gid0.org> | 2016-04-17 19:54:06 +0200 |
commit | b03a9f7252781b7fee75a684ba77650dc195dca5 (patch) | |
tree | 43d6a80f4f4cf47c5f571397a0a17ec6e7ef0083 /tmk_core/common/action_layer.c | |
parent | 0715cf46ac369921fd39b1b62d8a95fc89d48244 (diff) | |
parent | a67d425f4d5278595e7ab785a0f246b83fb1a09f (diff) |
Merge https://github.com/jackhumbert/qmk_firmware
Diffstat (limited to 'tmk_core/common/action_layer.c')
-rw-r--r-- | tmk_core/common/action_layer.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tmk_core/common/action_layer.c b/tmk_core/common/action_layer.c index fc721a7323..e817c0d515 100644 --- a/tmk_core/common/action_layer.c +++ b/tmk_core/common/action_layer.c @@ -111,7 +111,7 @@ void layer_debug(void) #endif #if !defined(NO_ACTION_LAYER) && defined(PREVENT_STUCK_MODIFIERS) -uint8_t source_layers_cache[MAX_LAYER_BITS][(MATRIX_ROWS * MATRIX_COLS + 7) / 8] = {0}; +uint8_t source_layers_cache[(MATRIX_ROWS * MATRIX_COLS + 7) / 8][MAX_LAYER_BITS] = {0}; void update_source_layers_cache(keypos_t key, uint8_t layer) { @@ -120,9 +120,9 @@ void update_source_layers_cache(keypos_t key, uint8_t layer) const uint8_t storage_bit = key_number % 8; for (uint8_t bit_number = 0; bit_number < MAX_LAYER_BITS; bit_number++) { - source_layers_cache[bit_number][storage_row] ^= + source_layers_cache[storage_row][bit_number] ^= (-((layer & (1U << bit_number)) != 0) - ^ source_layers_cache[bit_number][storage_row]) + ^ source_layers_cache[storage_row][bit_number]) & (1U << storage_bit); } } @@ -136,7 +136,7 @@ uint8_t read_source_layers_cache(keypos_t key) for (uint8_t bit_number = 0; bit_number < MAX_LAYER_BITS; bit_number++) { layer |= - ((source_layers_cache[bit_number][storage_row] + ((source_layers_cache[storage_row][bit_number] & (1U << storage_bit)) != 0) << bit_number; } |