Implement connection keycode logic (#25176)

This commit is contained in:
Joel Challis 2025-04-21 22:27:56 +01:00 committed by GitHub
parent ec324af22e
commit c7cb7ba976
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 347 additions and 99 deletions

View file

@ -41,6 +41,10 @@
# include "haptic.h"
#endif
#ifdef CONNECTION_ENABLE
# include "connection.h"
#endif
void nvm_eeconfig_erase(void) {
#ifdef EEPROM_DRIVER
eeprom_driver_format(false);
@ -196,6 +200,15 @@ void nvm_eeconfig_update_haptic(const haptic_config_t *haptic_config) {
}
#endif // HAPTIC_ENABLE
#ifdef CONNECTION_ENABLE
void nvm_eeconfig_read_connection(connection_config_t *config) {
config->raw = eeprom_read_byte(EECONFIG_CONNECTION);
}
void nvm_eeconfig_update_connection(const connection_config_t *config) {
eeprom_update_byte(EECONFIG_CONNECTION, config->raw);
}
#endif // CONNECTION_ENABLE
bool nvm_eeconfig_read_handedness(void) {
return !!eeprom_read_byte(EECONFIG_HANDEDNESS);
}

View file

@ -27,6 +27,7 @@ typedef struct PACKED {
};
uint32_t haptic;
uint8_t rgblight_ext;
uint8_t connection;
} eeprom_core_t;
/* EEPROM parameter address */
@ -46,6 +47,7 @@ typedef struct PACKED {
#define EECONFIG_RGB_MATRIX (uint64_t *)(offsetof(eeprom_core_t, rgb_matrix))
#define EECONFIG_HAPTIC (uint32_t *)(offsetof(eeprom_core_t, haptic))
#define EECONFIG_RGBLIGHT_EXTENDED (uint8_t *)(offsetof(eeprom_core_t, rgblight_ext))
#define EECONFIG_CONNECTION (uint8_t *)(offsetof(eeprom_core_t, connection))
// Size of EEPROM being used for core data storage
#define EECONFIG_BASE_SIZE ((uint8_t)sizeof(eeprom_core_t))