1
0
Fork 0

ARM split - Add bootmagic/magic keycodes for setting handedness (#6545)

* Add docs on bootmagic/magic keycodes for setting handedness

* Clang format fixes

* Maintain backwards compatibility

* Maintain backwards compatibility
This commit is contained in:
Joel Challis 2019-09-24 15:24:12 +01:00 committed by GitHub
parent 237147ca23
commit ad8dbd5ca5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 80 additions and 33 deletions

View file

@ -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

View file

@ -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

View file

@ -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); }

View file

@ -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