This commit is contained in:
Nick Brassel 2024-09-03 19:49:55 +10:00
parent bba99473c3
commit cbcbfbb6a0
No known key found for this signature in database
6 changed files with 36 additions and 16 deletions

View File

@ -12,10 +12,30 @@
# include "eeprom_driver.h" # include "eeprom_driver.h"
#endif // EEPROM_DRIVER #endif // EEPROM_DRIVER
#ifdef BACKLIGHT_ENABLE
# include "backlight.h"
#endif // BACKLIGHT_ENABLE
#ifdef AUDIO_ENABLE
# include "audio.h"
#endif // AUDIO_ENABLE
#ifdef RGBLIGHT_ENABLE #ifdef RGBLIGHT_ENABLE
# include "rgblight.h" # include "rgblight.h"
#endif // RGBLIGHT_ENABLE #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 #ifdef HAPTIC_ENABLE
# include "haptic.h" # include "haptic.h"
#endif // HAPTIC_ENABLE #endif // HAPTIC_ENABLE
@ -108,7 +128,7 @@ void eeconfig_init_quantum(void) {
#ifdef HAPTIC_ENABLE #ifdef HAPTIC_ENABLE
haptic_config_t haptic_config = {0}; haptic_config_t haptic_config = {0};
nvm_eeconfig_update_haptic(&hapitc_config); eeconfig_update_haptic(&haptic_config);
haptic_reset(); haptic_reset();
#endif // HAPTIC_ENABLE #endif // HAPTIC_ENABLE

View File

@ -97,15 +97,15 @@ void eeconfig_update_steno_mode(uint8_t val);
#endif // STENO_ENABLE #endif // STENO_ENABLE
#ifdef RGB_MATRIX_ENABLE #ifdef RGB_MATRIX_ENABLE
typedef struct rgb_config_t rgb_config_t; typedef union rgb_config_t rgb_config_t;
void eeconfig_read_rgb_matrix(rgb_config_t *rgb_matrix_config) __attribute__((nonnull)); 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)); void eeconfig_update_rgb_matrix(const rgb_config_t *rgb_matrix_config) __attribute__((nonnull));
#endif // RGB_MATRIX_ENABLE #endif // RGB_MATRIX_ENABLE
#ifdef LED_MATRIX_ENABLE #ifdef LED_MATRIX_ENABLE
typedef struct led_eeconfig_t led_eeconfig_t; typedef union led_eeconfig_t led_eeconfig_t;
void eeconfig_read_led_matrix(led_eeconfig_t *led_matrix_config) __attribute__((nonnull)); 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)); void eeconfig_update_led_matrix(const led_eeconfig_t *led_matrix_config) __attribute__((nonnull));
#endif // LED_MATRIX_ENABLE #endif // LED_MATRIX_ENABLE
#ifdef RGBLIGHT_ENABLE #ifdef RGBLIGHT_ENABLE

View File

@ -71,7 +71,7 @@ typedef struct PACKED {
uint8_t flags[LED_MATRIX_LED_COUNT]; uint8_t flags[LED_MATRIX_LED_COUNT];
} led_config_t; } led_config_t;
typedef union { typedef union led_eeconfig_t {
uint32_t raw; uint32_t raw;
struct PACKED { struct PACKED {
uint8_t enable : 2; uint8_t enable : 2;

View File

@ -46,15 +46,15 @@ void nvm_eeconfig_update_steno_mode(uint8_t val);
#endif // STENO_ENABLE #endif // STENO_ENABLE
#ifdef RGB_MATRIX_ENABLE #ifdef RGB_MATRIX_ENABLE
typedef struct rgb_config_t rgb_config_t; typedef union rgb_config_t rgb_config_t;
void nvm_eeconfig_read_rgb_matrix(rgb_config_t *rgb_matrix_config); 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); void nvm_eeconfig_update_rgb_matrix(const rgb_config_t *rgb_matrix_config);
#endif #endif
#ifdef LED_MATRIX_ENABLE #ifdef LED_MATRIX_ENABLE
typedef struct led_eeconfig_t led_eeconfig_t; typedef union led_eeconfig_t led_eeconfig_t;
void nvm_eeconfig_read_led_matrix(led_eeconfig_t *led_matrix_config); 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); void nvm_eeconfig_update_led_matrix(const led_eeconfig_t *led_matrix_config);
#endif // LED_MATRIX_ENABLE #endif // LED_MATRIX_ENABLE
#ifdef RGBLIGHT_ENABLE #ifdef RGBLIGHT_ENABLE

View File

@ -73,7 +73,7 @@ typedef struct PACKED {
uint8_t flags[RGB_MATRIX_LED_COUNT]; uint8_t flags[RGB_MATRIX_LED_COUNT];
} led_config_t; } led_config_t;
typedef union { typedef union rgb_config_t {
uint64_t raw; uint64_t raw;
struct PACKED { struct PACKED {
uint8_t enable : 2; uint8_t enable : 2;

View File

@ -165,7 +165,7 @@ uint8_t get_unicode_input_mode(void) {
} }
static void persist_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) { void set_unicode_input_mode(uint8_t mode) {