From b4f442dfeaf4d434ae0d8459dc5199cd8fefc1c7 Mon Sep 17 00:00:00 2001 From: Wojciech Siewierski Date: Sun, 27 Mar 2016 23:50:07 +0200 Subject: Cut the memory consumption of PREVENT_STUCK_MODIFIERS in half --- tmk_core/common/action_layer.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tmk_core/common/action_layer.h') diff --git a/tmk_core/common/action_layer.h b/tmk_core/common/action_layer.h index b6da353cfd..1a313a2590 100644 --- a/tmk_core/common/action_layer.h +++ b/tmk_core/common/action_layer.h @@ -71,6 +71,9 @@ void layer_xor(uint32_t state); #endif +/* return the topmost non-transparent layer currently associated with key */ +int8_t layer_switch_get_layer(keypos_t key); + /* return action depending on current layer status */ action_t layer_switch_get_action(keypos_t key); -- cgit v1.2.3 From 567f256c5d4598adb4dcd63fa4e4a7b4df553b12 Mon Sep 17 00:00:00 2001 From: Wojciech Siewierski Date: Tue, 5 Apr 2016 10:54:47 +0200 Subject: Refactor the source layer cache encoding --- tmk_core/common/action_layer.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tmk_core/common/action_layer.h') diff --git a/tmk_core/common/action_layer.h b/tmk_core/common/action_layer.h index 1a313a2590..3a4b1e3349 100644 --- a/tmk_core/common/action_layer.h +++ b/tmk_core/common/action_layer.h @@ -70,6 +70,14 @@ void layer_xor(uint32_t state); #define layer_debug() #endif +/* pressed actions cache */ +#if !defined(NO_ACTION_LAYER) && defined(PREVENT_STUCK_MODIFIERS) +/* The number of bits needed to represent the layer number: log2(32). */ +#define MAX_LAYER_BITS 5 +void update_source_layers_cache(keypos_t key, uint8_t layer); +uint8_t read_source_layers_cache(keypos_t key); +#endif +action_t store_or_get_action(bool pressed, keypos_t key); /* return the topmost non-transparent layer currently associated with key */ int8_t layer_switch_get_layer(keypos_t key); -- cgit v1.2.3 From f051496f1343259f4da8c5d917b9c9e47b97e38c Mon Sep 17 00:00:00 2001 From: IBNobody Date: Thu, 14 Apr 2016 18:01:29 -0500 Subject: Checkin --- tmk_core/common/action_layer.h | 1 + 1 file changed, 1 insertion(+) (limited to 'tmk_core/common/action_layer.h') diff --git a/tmk_core/common/action_layer.h b/tmk_core/common/action_layer.h index 3a4b1e3349..025cf5420f 100644 --- a/tmk_core/common/action_layer.h +++ b/tmk_core/common/action_layer.h @@ -68,6 +68,7 @@ void layer_xor(uint32_t state); #define layer_and(state) #define layer_xor(state) #define layer_debug() + #endif /* pressed actions cache */ -- cgit v1.2.3