summaryrefslogtreecommitdiff
path: root/tmk_core
diff options
context:
space:
mode:
authorPriyadi Iman Nurcahyo <priyadi@priyadi.net>2017-02-15 05:19:31 +0700
committerPriyadi Iman Nurcahyo <priyadi@priyadi.net>2017-02-15 05:19:31 +0700
commit3c8c3ebe3ffad774f0c3019654a5e185d37b8ebc (patch)
treeaf39807116b29ea518f1a28a72d6741800257d16 /tmk_core
parent5e310746339bcc37385bc6cd3e0a09fbdf1c273b (diff)
Bug fix & added default_layer_state_set_kb
Diffstat (limited to 'tmk_core')
-rw-r--r--tmk_core/common/action_layer.c6
-rw-r--r--tmk_core/common/action_layer.h7
2 files changed, 11 insertions, 2 deletions
diff --git a/tmk_core/common/action_layer.c b/tmk_core/common/action_layer.c
index 3363a2e532..58d919a04d 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 fc714700da..785bb5be44 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 */