summaryrefslogtreecommitdiff
path: root/tmk_core/common
diff options
context:
space:
mode:
authorEric-L-T <etang2099@gmail.com>2016-04-01 19:54:02 -0700
committerEric-L-T <etang2099@gmail.com>2016-04-01 19:54:02 -0700
commit307f1dee21ba8ffc94d50b6b9338d54fa2e4d191 (patch)
tree06f1dde5d2ef8a2d1b22738e9a50aed9ed710979 /tmk_core/common
parent420fc8620bfd47604848066b9d3798fb68a12e03 (diff)
Update action.c
Diffstat (limited to 'tmk_core/common')
-rw-r--r--tmk_core/common/action.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c
index e4cbac9e80..eecfdbb6da 100644
--- a/tmk_core/common/action.c
+++ b/tmk_core/common/action.c
@@ -82,19 +82,19 @@ action_t store_or_get_action(bool pressed, keypos_t key)
if (disable_action_cache) {
return layer_switch_get_action(key);
}
- int8_t key_number = key.col + (key.row * MATRIX_COLS);
- int8_t storage_row = key_number / 8;
- int8_t storage_bit = key_number % 8;
- int8_t layer;
+ uint8_t key_number = key.col + (key.row * MATRIX_COLS);
+ uint8_t storage_row = key_number / 8;
+ uint8_t storage_bit = key_number % 8;
+ uint8_t layer;
if (pressed) {
layer = layer_switch_get_layer(key);
- for (int8_t bit_number = 0; bit_number <= 4; bit_number++) {
- source_layers_cache[bit_number][storage_row] ^= (-(!!(layer & (1 << bit_number)) ^ source_layers_cache[bit_number][storage_row])) & (1 << storage_bit);
+ for (uint8_t bit_number = 0; bit_number <= 4; bit_number++) {
+ source_layers_cache[bit_number][storage_row] ^= (-(!!(layer & (1U << bit_number)) ^ source_layers_cache[bit_number][storage_row])) & (1U << storage_bit);
}
} else {
layer = 0;
- for (int8_t bit_number = 0; bit_number <= 4; bit_number++) {
- layer |= (!!(source_layers_cache[bit_number][storage_row] & (1 << storage_bit))) << bit_number;
+ for (uint8_t bit_number = 0; bit_number <= 4; bit_number++) {
+ layer |= (uint8_t)(!!(source_layers_cache[bit_number][storage_row] & (1U << storage_bit))) << bit_number;
}
}
return action_for_key(layer, key);