Skip to content

Commit

Permalink
Bug fix & added default_layer_state_set_kb
Browse files Browse the repository at this point in the history
  • Loading branch information
priyadi committed Feb 14, 2017
1 parent d369bfb commit d961759
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
6 changes: 6 additions & 0 deletions tmk_core/common/action_layer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 5 additions & 2 deletions tmk_core/common/action_layer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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 */
Expand Down

0 comments on commit d961759

Please sign in to comment.