From cbcbfbb6a047df1d91270dfba04d862e44ab547b Mon Sep 17 00:00:00 2001 From: Nick Brassel Date: Tue, 3 Sep 2024 19:49:55 +1000 Subject: [PATCH] fixups --- quantum/eeconfig.c | 22 +++++++++++++++++++++- quantum/eeconfig.h | 12 ++++++------ quantum/led_matrix/led_matrix_types.h | 2 +- quantum/nvm/nvm_eeconfig.h | 12 ++++++------ quantum/rgb_matrix/rgb_matrix_types.h | 2 +- quantum/unicode/unicode.c | 2 +- 6 files changed, 36 insertions(+), 16 deletions(-) diff --git a/quantum/eeconfig.c b/quantum/eeconfig.c index 30d0310812b..02bac3d32a6 100644 --- a/quantum/eeconfig.c +++ b/quantum/eeconfig.c @@ -12,10 +12,30 @@ # include "eeprom_driver.h" #endif // EEPROM_DRIVER +#ifdef BACKLIGHT_ENABLE +# include "backlight.h" +#endif // BACKLIGHT_ENABLE + +#ifdef AUDIO_ENABLE +# include "audio.h" +#endif // AUDIO_ENABLE + #ifdef RGBLIGHT_ENABLE # include "rgblight.h" #endif // RGBLIGHT_ENABLE +#ifdef RGB_MATRIX_ENABLE +# include "rgb_matrix_types.h" +#endif // RGB_MATRIX_ENABLE + +#ifdef LED_MATRIX_ENABLE +# include "led_matrix_types.h" +#endif // LED_MATRIX_ENABLE + +#ifdef UNICODE_COMMON_ENABLE +# include "unicode.h" +#endif // UNICODE_COMMON_ENABLE + #ifdef HAPTIC_ENABLE # include "haptic.h" #endif // HAPTIC_ENABLE @@ -108,7 +128,7 @@ void eeconfig_init_quantum(void) { #ifdef HAPTIC_ENABLE haptic_config_t haptic_config = {0}; - nvm_eeconfig_update_haptic(&hapitc_config); + eeconfig_update_haptic(&haptic_config); haptic_reset(); #endif // HAPTIC_ENABLE diff --git a/quantum/eeconfig.h b/quantum/eeconfig.h index e7b763af3d9..084abffe388 100644 --- a/quantum/eeconfig.h +++ b/quantum/eeconfig.h @@ -97,15 +97,15 @@ void eeconfig_update_steno_mode(uint8_t val); #endif // STENO_ENABLE #ifdef RGB_MATRIX_ENABLE -typedef struct rgb_config_t rgb_config_t; -void eeconfig_read_rgb_matrix(rgb_config_t *rgb_matrix_config) __attribute__((nonnull)); -void eeconfig_update_rgb_matrix(const rgb_config_t *rgb_matrix_config) __attribute__((nonnull)); +typedef union rgb_config_t rgb_config_t; +void eeconfig_read_rgb_matrix(rgb_config_t *rgb_matrix_config) __attribute__((nonnull)); +void eeconfig_update_rgb_matrix(const rgb_config_t *rgb_matrix_config) __attribute__((nonnull)); #endif // RGB_MATRIX_ENABLE #ifdef LED_MATRIX_ENABLE -typedef struct led_eeconfig_t led_eeconfig_t; -void eeconfig_read_led_matrix(led_eeconfig_t *led_matrix_config) __attribute__((nonnull)); -void eeconfig_update_led_matrix(const led_eeconfig_t *led_matrix_config) __attribute__((nonnull)); +typedef union led_eeconfig_t led_eeconfig_t; +void eeconfig_read_led_matrix(led_eeconfig_t *led_matrix_config) __attribute__((nonnull)); +void eeconfig_update_led_matrix(const led_eeconfig_t *led_matrix_config) __attribute__((nonnull)); #endif // LED_MATRIX_ENABLE #ifdef RGBLIGHT_ENABLE diff --git a/quantum/led_matrix/led_matrix_types.h b/quantum/led_matrix/led_matrix_types.h index 5a516ceb102..810420f46fd 100644 --- a/quantum/led_matrix/led_matrix_types.h +++ b/quantum/led_matrix/led_matrix_types.h @@ -71,7 +71,7 @@ typedef struct PACKED { uint8_t flags[LED_MATRIX_LED_COUNT]; } led_config_t; -typedef union { +typedef union led_eeconfig_t { uint32_t raw; struct PACKED { uint8_t enable : 2; diff --git a/quantum/nvm/nvm_eeconfig.h b/quantum/nvm/nvm_eeconfig.h index 310bb8b5f7f..7f51969da10 100644 --- a/quantum/nvm/nvm_eeconfig.h +++ b/quantum/nvm/nvm_eeconfig.h @@ -46,15 +46,15 @@ void nvm_eeconfig_update_steno_mode(uint8_t val); #endif // STENO_ENABLE #ifdef RGB_MATRIX_ENABLE -typedef struct rgb_config_t rgb_config_t; -void nvm_eeconfig_read_rgb_matrix(rgb_config_t *rgb_matrix_config); -void nvm_eeconfig_update_rgb_matrix(const rgb_config_t *rgb_matrix_config); +typedef union rgb_config_t rgb_config_t; +void nvm_eeconfig_read_rgb_matrix(rgb_config_t *rgb_matrix_config); +void nvm_eeconfig_update_rgb_matrix(const rgb_config_t *rgb_matrix_config); #endif #ifdef LED_MATRIX_ENABLE -typedef struct led_eeconfig_t led_eeconfig_t; -void nvm_eeconfig_read_led_matrix(led_eeconfig_t *led_matrix_config); -void nvm_eeconfig_update_led_matrix(const led_eeconfig_t *led_matrix_config); +typedef union led_eeconfig_t led_eeconfig_t; +void nvm_eeconfig_read_led_matrix(led_eeconfig_t *led_matrix_config); +void nvm_eeconfig_update_led_matrix(const led_eeconfig_t *led_matrix_config); #endif // LED_MATRIX_ENABLE #ifdef RGBLIGHT_ENABLE diff --git a/quantum/rgb_matrix/rgb_matrix_types.h b/quantum/rgb_matrix/rgb_matrix_types.h index 0a3fd7cc0d1..ad416b0fedf 100644 --- a/quantum/rgb_matrix/rgb_matrix_types.h +++ b/quantum/rgb_matrix/rgb_matrix_types.h @@ -73,7 +73,7 @@ typedef struct PACKED { uint8_t flags[RGB_MATRIX_LED_COUNT]; } led_config_t; -typedef union { +typedef union rgb_config_t { uint64_t raw; struct PACKED { uint8_t enable : 2; diff --git a/quantum/unicode/unicode.c b/quantum/unicode/unicode.c index 3da2fd2c60f..b0729335f07 100644 --- a/quantum/unicode/unicode.c +++ b/quantum/unicode/unicode.c @@ -165,7 +165,7 @@ uint8_t get_unicode_input_mode(void) { } static void persist_unicode_input_mode(void) { - eeconfig_update_unicode_mode(unicode_config.input_mode); + eeconfig_update_unicode_mode(&unicode_config); } void set_unicode_input_mode(uint8_t mode) {