aboutsummaryrefslogtreecommitdiff
path: root/tmk_core
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2019-09-27 21:33:55 +0100
committerGitHub <noreply@github.com>2019-09-27 21:33:55 +0100
commit17794e0b2502371eaf155328d4e4195aef703163 (patch)
treee3912e2f393e6395a20d26f7dbbf60369837765a /tmk_core
parent92cb0b6f2f9487aff42ad1de5d4a9b81e24e836c (diff)
downloadqmk_firmware-17794e0b2502371eaf155328d4e4195aef703163.tar.gz
qmk_firmware-17794e0b2502371eaf155328d4e4195aef703163.zip
ARM split - Add support for dfu-util EE_HANDS flashing (#6543)
* Initial stab at some fake dfu-util-split-left behaviour * Apply suggestions from code review Co-Authored-By: fauxpark <fauxpark@gmail.com> * Clang format fixes * Fake eeprom init for both left and right hand
Diffstat (limited to 'tmk_core')
-rw-r--r--tmk_core/chibios.mk15
-rw-r--r--tmk_core/common/eeconfig.c10
2 files changed, 25 insertions, 0 deletions
diff --git a/tmk_core/chibios.mk b/tmk_core/chibios.mk
index c25e28707..62e156187 100644
--- a/tmk_core/chibios.mk
+++ b/tmk_core/chibios.mk
@@ -248,6 +248,21 @@ dfu-util: $(BUILD_DIR)/$(TARGET).bin cpfirmware sizeafter
248# Legacy alias 248# Legacy alias
249dfu-util-wait: dfu-util 249dfu-util-wait: dfu-util
250 250
251# TODO: Remove once ARM has a way to configure EECONFIG_HANDEDNESS
252# within the emulated eeprom via dfu-util or another tool
253ifneq (,$(filter $(MAKECMDGOALS),dfu-util-split-left))
254 OPT_DEFS += -DINIT_EE_HANDS_LEFT
255endif
256
257ifneq (,$(filter $(MAKECMDGOALS),dfu-util-split-right))
258 OPT_DEFS += -DINIT_EE_HANDS_RIGHT
259endif
260
261dfu-util-split-left: dfu-util
262
263dfu-util-split-right: dfu-util
264
265
251st-link-cli: $(BUILD_DIR)/$(TARGET).hex sizeafter 266st-link-cli: $(BUILD_DIR)/$(TARGET).hex sizeafter
252 $(ST_LINK_CLI) $(ST_LINK_ARGS) -q -c SWD -p $(BUILD_DIR)/$(TARGET).hex -Rst 267 $(ST_LINK_CLI) $(ST_LINK_ARGS) -q -c SWD -p $(BUILD_DIR)/$(TARGET).hex -Rst
253 268
diff --git a/tmk_core/common/eeconfig.c b/tmk_core/common/eeconfig.c
index 933ac42bd..4cf4ca3ac 100644
--- a/tmk_core/common/eeconfig.c
+++ b/tmk_core/common/eeconfig.c
@@ -48,6 +48,16 @@ void eeconfig_init_quantum(void) {
48 eeprom_update_dword(EECONFIG_RGB_MATRIX, 0); 48 eeprom_update_dword(EECONFIG_RGB_MATRIX, 0);
49 eeprom_update_byte(EECONFIG_RGB_MATRIX_SPEED, 0); 49 eeprom_update_byte(EECONFIG_RGB_MATRIX_SPEED, 0);
50 50
51 // TODO: Remove once ARM has a way to configure EECONFIG_HANDEDNESS
52 // within the emulated eeprom via dfu-util or another tool
53#if defined INIT_EE_HANDS_LEFT
54 #pragma message "Faking EE_HANDS for left hand"
55 eeprom_update_byte(EECONFIG_HANDEDNESS, 1);
56#elif defined INIT_EE_HANDS_RIGHT
57 #pragma message "Faking EE_HANDS for right hand"
58 eeprom_update_byte(EECONFIG_HANDEDNESS, 0);
59#endif
60
51 eeconfig_init_kb(); 61 eeconfig_init_kb();
52} 62}
53 63