diff options
author | QMK Bot <hello@qmk.fm> | 2023-05-31 18:44:47 +0000 |
---|---|---|
committer | QMK Bot <hello@qmk.fm> | 2023-05-31 18:44:47 +0000 |
commit | b3a7f80e1ad3491bd7f58dad518554717126c1b9 (patch) | |
tree | 65d3bd98395e59eb3d51333a591c5fb42699c292 /users/drashna/rgb/rgb_matrix_stuff.c | |
parent | cc11b63d872db4090913d052706de452592143c4 (diff) | |
parent | 3a3e5abac992712a8bb4e9b61430f5fc62dc6043 (diff) |
Merge remote-tracking branch 'origin/master' into develop
Diffstat (limited to 'users/drashna/rgb/rgb_matrix_stuff.c')
-rw-r--r-- | users/drashna/rgb/rgb_matrix_stuff.c | 44 |
1 files changed, 43 insertions, 1 deletions
diff --git a/users/drashna/rgb/rgb_matrix_stuff.c b/users/drashna/rgb/rgb_matrix_stuff.c index eff9191eb7..588e51daf9 100644 --- a/users/drashna/rgb/rgb_matrix_stuff.c +++ b/users/drashna/rgb/rgb_matrix_stuff.c @@ -74,7 +74,7 @@ bool process_record_user_rgb_matrix(uint16_t keycode, keyrecord_t *record) { if (record->event.pressed) { userspace_config.rgb_matrix_idle_anim ^= 1; dprintf("RGB Matrix Idle Animation [EEPROM]: %u\n", userspace_config.rgb_matrix_idle_anim); - eeconfig_update_user(userspace_config.raw); + eeconfig_update_user_config(&userspace_config.raw); if (userspace_config.rgb_matrix_idle_anim) { rgb_matrix_mode_noeeprom(RGB_MATRIX_TYPING_HEATMAP); } @@ -146,3 +146,45 @@ __attribute__((weak)) bool rgb_matrix_indicators_keymap(void) { bool rgb_matrix_indicators_user(void) { return rgb_matrix_indicators_keymap(); } + + +//---------------------------------------------------------- +// RGB Matrix naming +#include <rgb_matrix.h> + +#if defined(RGB_MATRIX_EFFECT) +# undef RGB_MATRIX_EFFECT +#endif // defined(RGB_MATRIX_EFFECT) + +#define RGB_MATRIX_EFFECT(x) RGB_MATRIX_EFFECT_##x, +enum { + RGB_MATRIX_EFFECT_NONE, +#include "rgb_matrix_effects.inc" +#undef RGB_MATRIX_EFFECT +#ifdef RGB_MATRIX_CUSTOM_KB +# include "rgb_matrix_kb.inc" +#endif +#ifdef RGB_MATRIX_CUSTOM_USER +# include "rgb_matrix_user.inc" +#endif +}; + +#define RGB_MATRIX_EFFECT(x) \ + case RGB_MATRIX_EFFECT_##x: \ + return #x; +const char* rgb_matrix_name(uint8_t effect) { + switch (effect) { + case RGB_MATRIX_EFFECT_NONE: + return "NONE"; +#include "rgb_matrix_effects.inc" +#undef RGB_MATRIX_EFFECT +#ifdef RGB_MATRIX_CUSTOM_KB +# include "rgb_matrix_kb.inc" +#endif +#ifdef RGB_MATRIX_CUSTOM_USER +# include "rgb_matrix_user.inc" +#endif + default: + return "UNKNOWN"; + } +} |