aboutsummaryrefslogtreecommitdiffstats
path: root/tmk_core/common/action.c
diff options
context:
space:
mode:
authorWojciech Siewierski <wojciech.siewierski@onet.pl>2016-04-05 10:54:47 +0200
committerWojciech Siewierski <wojciech.siewierski@onet.pl>2016-04-05 11:08:04 +0200
commit567f256c5d4598adb4dcd63fa4e4a7b4df553b12 (patch)
treea9999db4f3d600d230227e6b4f4c22013dd325b8 /tmk_core/common/action.c
parent47dd29513eeec7b7f639bef6df441a905ce8bacb (diff)
downloadfirmware-567f256c5d4598adb4dcd63fa4e4a7b4df553b12.tar.gz
firmware-567f256c5d4598adb4dcd63fa4e4a7b4df553b12.tar.bz2
firmware-567f256c5d4598adb4dcd63fa4e4a7b4df553b12.zip
Refactor the source layer cache encoding
Diffstat (limited to 'tmk_core/common/action.c')
-rw-r--r--tmk_core/common/action.c41
1 files changed, 0 insertions, 41 deletions
diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c
index 20e1fc614..6aa6dc260 100644
--- a/tmk_core/common/action.c
+++ b/tmk_core/common/action.c
@@ -55,7 +55,6 @@ void action_exec(keyevent_t event)
#if !defined(NO_ACTION_LAYER) && defined(PREVENT_STUCK_MODIFIERS)
bool disable_action_cache = false;
-uint8_t source_layers_cache[5][(MATRIX_ROWS * MATRIX_COLS + 7) / 8] = {0};
void process_action_nocache(keyrecord_t *record)
{
@@ -70,46 +69,6 @@ void process_action_nocache(keyrecord_t *record)
}
#endif
-/*
- * Make sure the action triggered when the key is released is the same
- * one as the one triggered on press. It's important for the mod keys
- * when the layer is switched after the down event but before the up
- * event as they may get stuck otherwise.
- */
-action_t store_or_get_action(bool pressed, keypos_t key)
-{
-#if !defined(NO_ACTION_LAYER) && defined(PREVENT_STUCK_MODIFIERS)
- if (disable_action_cache) {
- return layer_switch_get_action(key);
- }
- const uint8_t key_number = key.col + (key.row * MATRIX_COLS);
- const uint8_t storage_row = key_number / 8;
- const uint8_t storage_bit = key_number % 8;
- uint8_t layer;
- if (pressed) {
- layer = layer_switch_get_layer(key);
- for (uint8_t bit_number = 0; bit_number < 5; bit_number++) {
- source_layers_cache[bit_number][storage_row] ^=
- (-((layer & (1U << bit_number)) != 0)
- ^ source_layers_cache[bit_number][storage_row])
- & (1U << storage_bit);
- }
- }
- else {
- layer = 0;
- for (uint8_t bit_number = 0; bit_number < 5; bit_number++) {
- layer |=
- ((source_layers_cache[bit_number][storage_row]
- & (1U << storage_bit)) != 0)
- << bit_number;
- }
- }
- return action_for_key(layer, key);
-#else
- return layer_switch_get_action(key);
-#endif
-}
-
__attribute__ ((weak))
void process_action_kb(keyrecord_t *record) {}