~ruther/qmk_firmware

e1aed8da08468fd04bb9e33129a5a26b80c0e093 — Dasky 3 years ago 08738aa
Move fake EE_HANDS (#18352)

2 files changed, 14 insertions(+), 10 deletions(-)

M quantum/eeconfig.c
M quantum/split_common/split_util.c
M quantum/eeconfig.c => quantum/eeconfig.c +0 -10
@@ 57,16 57,6 @@ void eeconfig_init_quantum(void) {
    eeprom_update_dword(EECONFIG_RGB_MATRIX, 0);
    eeprom_update_word(EECONFIG_RGB_MATRIX_EXTENDED, 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

#if defined(HAPTIC_ENABLE)
    haptic_reset();
#else

M quantum/split_common/split_util.c => quantum/split_common/split_util.c +14 -0
@@ 139,6 139,20 @@ void split_pre_init(void) {
    if (!eeconfig_is_enabled()) {
        eeconfig_init();
    }
    // 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) || defined(INIT_EE_HANDS_RIGHT)
#        if defined(INIT_EE_HANDS_LEFT)
#            pragma message "Faking EE_HANDS for left hand"
    const bool should_be_left = true;
#        else
#            pragma message "Faking EE_HANDS for right hand"
    const bool should_be_left = false;
#        endif
    bool       is_left        = eeconfig_read_handedness();
    if (is_left != should_be_left) {
        eeconfig_update_handedness(should_be_left);
    }
#    endif // defined(INIT_EE_HANDS_LEFT) || defined(INIT_EE_HANDS_RIGHT)
#endif
    isLeftHand = is_keyboard_left();