From e6c2ae8c6d892f71b62f07c10aed2aa0a2dc9221 Mon Sep 17 00:00:00 2001 From: Drashna Jael're Date: Thu, 28 Jan 2021 14:40:46 -0800 Subject: [PATCH] Add check for split boards, and comments --- tmk_core/common/action_layer.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tmk_core/common/action_layer.c b/tmk_core/common/action_layer.c index 5210b52c764..c62a044b0c7 100644 --- a/tmk_core/common/action_layer.c +++ b/tmk_core/common/action_layer.c @@ -34,11 +34,15 @@ __attribute__((weak)) layer_state_t default_layer_state_set_kb(layer_state_t sta static void default_layer_state_set(layer_state_t state) { state = default_layer_state_set_kb(state); static bool has_run = false; - if (has_run) { +#ifdef SPLIT_KEYBOARD // if split, only run on master + if (has_run && is_keyboard_master()) +#else // so this only writes to eeprom after first run, as it's run at startup, by default. + if (has_run) +#endif + { eeconfig_update_default_layer(state); - } else { - has_run = true; } + has_run = true; debug("default_layer_state: "); default_layer_debug(); debug(" to ");