diff options
| -rw-r--r-- | tmk_core/common/action_layer.c | 12 | ||||
| -rw-r--r-- | tmk_core/common/action_layer.h | 5 |
2 files changed, 17 insertions, 0 deletions
diff --git a/tmk_core/common/action_layer.c b/tmk_core/common/action_layer.c index a3c757964..58d919a04 100644 --- a/tmk_core/common/action_layer.c +++ b/tmk_core/common/action_layer.c | |||
| @@ -16,8 +16,14 @@ | |||
| 16 | */ | 16 | */ |
| 17 | uint32_t default_layer_state = 0; | 17 | uint32_t default_layer_state = 0; |
| 18 | 18 | ||
| 19 | __attribute__((weak)) | ||
| 20 | uint32_t default_layer_state_set_kb(uint32_t state) { | ||
| 21 | return state; | ||
| 22 | } | ||
| 23 | |||
| 19 | static void default_layer_state_set(uint32_t state) | 24 | static void default_layer_state_set(uint32_t state) |
| 20 | { | 25 | { |
| 26 | state = default_layer_state_set_kb(state); | ||
| 21 | debug("default_layer_state: "); | 27 | debug("default_layer_state: "); |
| 22 | default_layer_debug(); debug(" to "); | 28 | default_layer_debug(); debug(" to "); |
| 23 | default_layer_state = state; | 29 | default_layer_state = state; |
| @@ -57,8 +63,14 @@ void default_layer_xor(uint32_t state) | |||
| 57 | */ | 63 | */ |
| 58 | uint32_t layer_state = 0; | 64 | uint32_t layer_state = 0; |
| 59 | 65 | ||
| 66 | __attribute__((weak)) | ||
| 67 | uint32_t layer_state_set_kb(uint32_t state) { | ||
| 68 | return state; | ||
| 69 | } | ||
| 70 | |||
| 60 | static void layer_state_set(uint32_t state) | 71 | static void layer_state_set(uint32_t state) |
| 61 | { | 72 | { |
| 73 | state = layer_state_set_kb(state); | ||
| 62 | dprint("layer_state: "); | 74 | dprint("layer_state: "); |
| 63 | layer_debug(); dprint(" to "); | 75 | layer_debug(); dprint(" to "); |
| 64 | layer_state = state; | 76 | layer_state = state; |
diff --git a/tmk_core/common/action_layer.h b/tmk_core/common/action_layer.h index 025cf5420..d89ed6e5c 100644 --- a/tmk_core/common/action_layer.h +++ b/tmk_core/common/action_layer.h | |||
| @@ -29,6 +29,9 @@ extern uint32_t default_layer_state; | |||
| 29 | void default_layer_debug(void); | 29 | void default_layer_debug(void); |
| 30 | void default_layer_set(uint32_t state); | 30 | void default_layer_set(uint32_t state); |
| 31 | 31 | ||
| 32 | __attribute__((weak)) | ||
| 33 | uint32_t default_layer_state_set_kb(uint32_t state); | ||
| 34 | |||
| 32 | #ifndef NO_ACTION_LAYER | 35 | #ifndef NO_ACTION_LAYER |
| 33 | /* bitwise operation */ | 36 | /* bitwise operation */ |
| 34 | void default_layer_or(uint32_t state); | 37 | void default_layer_or(uint32_t state); |
| @@ -69,6 +72,8 @@ void layer_xor(uint32_t state); | |||
| 69 | #define layer_xor(state) | 72 | #define layer_xor(state) |
| 70 | #define layer_debug() | 73 | #define layer_debug() |
| 71 | 74 | ||
| 75 | __attribute__((weak)) | ||
| 76 | uint32_t layer_state_set_kb(uint32_t state); | ||
| 72 | #endif | 77 | #endif |
| 73 | 78 | ||
| 74 | /* pressed actions cache */ | 79 | /* pressed actions cache */ |
