summaryrefslogtreecommitdiffstats
path: root/tmk_core
diff options
context:
space:
mode:
Diffstat (limited to 'tmk_core')
-rw-r--r--tmk_core/common/bootmagic.c8
-rw-r--r--tmk_core/common/bootmagic.h6
-rw-r--r--tmk_core/common/eeconfig.c19
-rw-r--r--tmk_core/common/eeconfig.h3
4 files changed, 34 insertions, 2 deletions
diff --git a/tmk_core/common/bootmagic.c b/tmk_core/common/bootmagic.c
index 09b1664c90..bb2aa0db8c 100644
--- a/tmk_core/common/bootmagic.c
+++ b/tmk_core/common/bootmagic.c
@@ -122,6 +122,14 @@ void bootmagic(void) {
default_layer = eeconfig_read_default_layer();
default_layer_set((layer_state_t)default_layer);
}
+
+ /* EE_HANDS handedness */
+ if (bootmagic_scan_keycode(BOOTMAGIC_KEY_EE_HANDS_LEFT)) {
+ eeconfig_update_handedness(true);
+ }
+ if (bootmagic_scan_keycode(BOOTMAGIC_KEY_EE_HANDS_RIGHT)) {
+ eeconfig_update_handedness(false);
+ }
}
/** \brief Scan Keycode
diff --git a/tmk_core/common/bootmagic.h b/tmk_core/common/bootmagic.h
index fb76472579..c64dc17858 100644
--- a/tmk_core/common/bootmagic.h
+++ b/tmk_core/common/bootmagic.h
@@ -36,6 +36,12 @@
#ifndef BOOTMAGIC_KEY_DEBUG_MOUSE
# define BOOTMAGIC_KEY_DEBUG_MOUSE KC_M
#endif
+#ifndef BOOTMAGIC_KEY_EE_HANDS_LEFT
+# define BOOTMAGIC_KEY_EE_HANDS_LEFT KC_L
+#endif
+#ifndef BOOTMAGIC_KEY_EE_HANDS_RIGHT
+# define BOOTMAGIC_KEY_EE_HANDS_RIGHT KC_R
+#endif
/*
* keymap config
diff --git a/tmk_core/common/eeconfig.c b/tmk_core/common/eeconfig.c
index 61aaec2054..933ac42bd2 100644
--- a/tmk_core/common/eeconfig.c
+++ b/tmk_core/common/eeconfig.c
@@ -153,8 +153,8 @@ uint32_t eeconfig_read_kb(void) { return eeprom_read_dword(EECONFIG_KEYBOARD); }
*
* FIXME: needs doc
*/
-
void eeconfig_update_kb(uint32_t val) { eeprom_update_dword(EECONFIG_KEYBOARD, val); }
+
/** \brief eeconfig read user
*
* FIXME: needs doc
@@ -166,9 +166,24 @@ uint32_t eeconfig_read_user(void) { return eeprom_read_dword(EECONFIG_USER); }
*/
void eeconfig_update_user(uint32_t val) { eeprom_update_dword(EECONFIG_USER, val); }
+/** \brief eeconfig read haptic
+ *
+ * FIXME: needs doc
+ */
uint32_t eeconfig_read_haptic(void) { return eeprom_read_dword(EECONFIG_HAPTIC); }
-/** \brief eeconfig update user
+/** \brief eeconfig update haptic
*
* FIXME: needs doc
*/
void eeconfig_update_haptic(uint32_t val) { eeprom_update_dword(EECONFIG_HAPTIC, val); }
+
+/** \brief eeconfig read split handedness
+ *
+ * FIXME: needs doc
+ */
+bool eeconfig_read_handedness(void) { return !!eeprom_read_byte(EECONFIG_HANDEDNESS); }
+/** \brief eeconfig update split handedness
+ *
+ * FIXME: needs doc
+ */
+void eeconfig_update_handedness(bool val) { eeprom_update_byte(EECONFIG_HANDEDNESS, !!val); }
diff --git a/tmk_core/common/eeconfig.h b/tmk_core/common/eeconfig.h
index aea4eff9f6..308f865e19 100644
--- a/tmk_core/common/eeconfig.h
+++ b/tmk_core/common/eeconfig.h
@@ -107,4 +107,7 @@ uint32_t eeconfig_read_haptic(void);
void eeconfig_update_haptic(uint32_t val);
#endif
+bool eeconfig_read_handedness(void);
+void eeconfig_update_handedness(bool val);
+
#endif