diff options
| author | Priyadi Iman Nurcahyo <priyadi@priyadi.net> | 2017-02-15 05:11:24 +0700 |
|---|---|---|
| committer | Priyadi Iman Nurcahyo <priyadi@priyadi.net> | 2017-02-15 05:11:24 +0700 |
| commit | 5e310746339bcc37385bc6cd3e0a09fbdf1c273b (patch) | |
| tree | 77085a47bb8f475d0ac0703ade96def4cb7d01a4 | |
| parent | df311c7b40cb6e611a522331dca9836f6eef9dce (diff) | |
| parent | d369bfb83a74d94ed0fbb13f8ee3a8a1146da770 (diff) | |
| download | qmk_firmware-5e310746339bcc37385bc6cd3e0a09fbdf1c273b.tar.gz qmk_firmware-5e310746339bcc37385bc6cd3e0a09fbdf1c273b.zip | |
Merge branch 'layer_state_set_kb' into promethium
| -rw-r--r-- | tmk_core/common/action_layer.c | 6 | ||||
| -rw-r--r-- | tmk_core/common/action_layer.h | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/tmk_core/common/action_layer.c b/tmk_core/common/action_layer.c index a3c757964..3363a2e53 100644 --- a/tmk_core/common/action_layer.c +++ b/tmk_core/common/action_layer.c | |||
| @@ -57,8 +57,14 @@ void default_layer_xor(uint32_t state) | |||
| 57 | */ | 57 | */ |
| 58 | uint32_t layer_state = 0; | 58 | uint32_t layer_state = 0; |
| 59 | 59 | ||
| 60 | __attribute__((weak)) | ||
| 61 | uint32_t layer_state_set_kb(uint32_t state) { | ||
| 62 | return state; | ||
| 63 | } | ||
| 64 | |||
| 60 | static void layer_state_set(uint32_t state) | 65 | static void layer_state_set(uint32_t state) |
| 61 | { | 66 | { |
| 67 | state = layer_state_set_kb(state); | ||
| 62 | dprint("layer_state: "); | 68 | dprint("layer_state: "); |
| 63 | layer_debug(); dprint(" to "); | 69 | layer_debug(); dprint(" to "); |
| 64 | layer_state = state; | 70 | layer_state = state; |
diff --git a/tmk_core/common/action_layer.h b/tmk_core/common/action_layer.h index 025cf5420..fc714700d 100644 --- a/tmk_core/common/action_layer.h +++ b/tmk_core/common/action_layer.h | |||
| @@ -69,6 +69,8 @@ void layer_xor(uint32_t state); | |||
| 69 | #define layer_xor(state) | 69 | #define layer_xor(state) |
| 70 | #define layer_debug() | 70 | #define layer_debug() |
| 71 | 71 | ||
| 72 | __attribute__((weak)) | ||
| 73 | void layer_state_set_kb(uint32_t oldstate, uint32_t newstate); | ||
| 72 | #endif | 74 | #endif |
| 73 | 75 | ||
| 74 | /* pressed actions cache */ | 76 | /* pressed actions cache */ |
