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:20:15 +0700
commitd96175937bfa9f700d9ee54c20e5d963c12d02df (patch)
treeb4f6dae200aeb59398790ef40fb85d92a9f225e1 /tmk_core
parentd369bfb83a74d94ed0fbb13f8ee3a8a1146da770 (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 */