diff options
author | Priyadi Iman Nurcahyo <priyadi@priyadi.net> | 2017-02-15 05:19:31 +0700 |
---|---|---|
committer | Priyadi Iman Nurcahyo <priyadi@priyadi.net> | 2017-02-15 05:20:15 +0700 |
commit | d96175937bfa9f700d9ee54c20e5d963c12d02df (patch) | |
tree | b4f6dae200aeb59398790ef40fb85d92a9f225e1 /tmk_core/common | |
parent | d369bfb83a74d94ed0fbb13f8ee3a8a1146da770 (diff) | |
download | qmk_firmware-d96175937bfa9f700d9ee54c20e5d963c12d02df.tar.gz |
Bug fix & added default_layer_state_set_kb
Diffstat (limited to 'tmk_core/common')
-rw-r--r-- | tmk_core/common/action_layer.c | 6 | ||||
-rw-r--r-- | tmk_core/common/action_layer.h | 7 |
2 files changed, 11 insertions, 2 deletions
diff --git a/tmk_core/common/action_layer.c b/tmk_core/common/action_layer.c index 3363a2e53..58d919a04 100644 --- a/tmk_core/common/action_layer.c +++ b/tmk_core/common/action_layer.c @@ -16,8 +16,14 @@ */ uint32_t default_layer_state = 0; +__attribute__((weak)) +uint32_t default_layer_state_set_kb(uint32_t state) { + return state; +} + static void default_layer_state_set(uint32_t state) { + state = default_layer_state_set_kb(state); debug("default_layer_state: "); default_layer_debug(); debug(" to "); default_layer_state = state; diff --git a/tmk_core/common/action_layer.h b/tmk_core/common/action_layer.h index fc714700d..785bb5be4 100644 --- a/tmk_core/common/action_layer.h +++ b/tmk_core/common/action_layer.h @@ -27,7 +27,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ extern uint32_t default_layer_state; void default_layer_debug(void); -void default_layer_set(uint32_t state); +uint32_t default_layer_set(uint32_t state); + +__attribute__((weak)) +void default_layer_state_set_kb(uint32_t state); #ifndef NO_ACTION_LAYER /* bitwise operation */ @@ -70,7 +73,7 @@ void layer_xor(uint32_t state); #define layer_debug() __attribute__((weak)) -void layer_state_set_kb(uint32_t oldstate, uint32_t newstate); +uint32_t layer_state_set_kb(uint32_t state); #endif /* pressed actions cache */ |