diff --git a/tmk_core/chibios.mk b/tmk_core/chibios.mk index c25e287071f9..62e1561878aa 100644 --- a/tmk_core/chibios.mk +++ b/tmk_core/chibios.mk @@ -248,6 +248,21 @@ dfu-util: $(BUILD_DIR)/$(TARGET).bin cpfirmware sizeafter # Legacy alias dfu-util-wait: dfu-util +# TODO: Remove once ARM has a way to configure EECONFIG_HANDEDNESS +# within the emulated eeprom via dfu-util or another tool +ifneq (,$(filter $(MAKECMDGOALS),dfu-util-split-left)) + OPT_DEFS += -DINIT_EE_HANDS_LEFT +endif + +ifneq (,$(filter $(MAKECMDGOALS),dfu-util-split-right)) + OPT_DEFS += -DINIT_EE_HANDS_RIGHT +endif + +dfu-util-split-left: dfu-util + +dfu-util-split-right: dfu-util + + st-link-cli: $(BUILD_DIR)/$(TARGET).hex sizeafter $(ST_LINK_CLI) $(ST_LINK_ARGS) -q -c SWD -p $(BUILD_DIR)/$(TARGET).hex -Rst diff --git a/tmk_core/common/eeconfig.c b/tmk_core/common/eeconfig.c index 07b818ea68f9..f33d831f77d1 100644 --- a/tmk_core/common/eeconfig.c +++ b/tmk_core/common/eeconfig.c @@ -48,6 +48,16 @@ void eeconfig_init_quantum(void) { eeprom_update_dword(EECONFIG_RGB_MATRIX, 0); eeprom_update_byte(EECONFIG_RGB_MATRIX_SPEED, 0); + // TODO: Remove once ARM has a way to configure EECONFIG_HANDEDNESS + // within the emulated eeprom via dfu-util or another tool +#if defined INIT_EE_HANDS_LEFT + #pragma message "Faking EE_HANDS for left hand" + eeprom_update_byte(EECONFIG_HANDEDNESS, 1); +#elif defined INIT_EE_HANDS_RIGHT + #pragma message "Faking EE_HANDS for right hand" + eeprom_update_byte(EECONFIG_HANDEDNESS, 0); +#endif + eeconfig_init_kb(); }