summaryrefslogtreecommitdiff
path: root/users/drashna/rgb/rgb_matrix_stuff.c
diff options
context:
space:
mode:
Diffstat (limited to 'users/drashna/rgb/rgb_matrix_stuff.c')
-rw-r--r--users/drashna/rgb/rgb_matrix_stuff.c44
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";
+ }
+}