summaryrefslogtreecommitdiff
path: root/quantum/rgb_matrix/rgb_matrix.h
diff options
context:
space:
mode:
authorLess/Rikki <86894501+lesshonor@users.noreply.github.com>2023-09-28 06:51:18 -0400
committerGitHub <noreply@github.com>2023-09-28 11:51:18 +0100
commit346b06d391dbc760d753a5cffcbbcb58ecc9ce95 (patch)
tree3c87de30a731a90ee3594f421d4dd54e076d2819 /quantum/rgb_matrix/rgb_matrix.h
parentf4677c866e1b4456e1e4bb72265a7d4326eb4816 (diff)
refactor: move default RGB/LED matrix #defines (#21938)
* refactor: move default RGB/LED matrix #defines Moving the fallback definitions of macros like LED_MATRIX_VAL_STEP and RGB_MATRIX_MAXIMUM_BRIGHTNESS to header files allows keyboards to leverage these defaults without requiring #ifdef guards (and often repeating said fallback definitions). * style: use if(n)def for consistency and remove redundant UINT8_MAX checks on maximum brightness Co-authored-by: Joel Challis <git@zvecr.com> * refactor: remove INDICATOR_MAX_BRIGHTNESS macro Co-authored-by: Joel Challis <git@zvecr.com> --------- Co-authored-by: Joel Challis <git@zvecr.com>
Diffstat (limited to 'quantum/rgb_matrix/rgb_matrix.h')
-rw-r--r--quantum/rgb_matrix/rgb_matrix.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/quantum/rgb_matrix/rgb_matrix.h b/quantum/rgb_matrix/rgb_matrix.h
index e4807ee54a..025a1f4700 100644
--- a/quantum/rgb_matrix/rgb_matrix.h
+++ b/quantum/rgb_matrix/rgb_matrix.h
@@ -46,6 +46,55 @@
# include "ws2812.h"
#endif
+#ifndef RGB_MATRIX_TIMEOUT
+# define RGB_MATRIX_TIMEOUT 0
+#endif
+
+#ifndef RGB_MATRIX_MAXIMUM_BRIGHTNESS
+# define RGB_MATRIX_MAXIMUM_BRIGHTNESS UINT8_MAX
+#endif
+
+#ifndef RGB_MATRIX_HUE_STEP
+# define RGB_MATRIX_HUE_STEP 8
+#endif
+
+#ifndef RGB_MATRIX_SAT_STEP
+# define RGB_MATRIX_SAT_STEP 16
+#endif
+
+#ifndef RGB_MATRIX_VAL_STEP
+# define RGB_MATRIX_VAL_STEP 16
+#endif
+
+#ifndef RGB_MATRIX_SPD_STEP
+# define RGB_MATRIX_SPD_STEP 16
+#endif
+
+#ifndef RGB_MATRIX_DEFAULT_MODE
+# ifdef ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT
+# define RGB_MATRIX_DEFAULT_MODE RGB_MATRIX_CYCLE_LEFT_RIGHT
+# else
+// fallback to solid colors if RGB_MATRIX_CYCLE_LEFT_RIGHT is disabled in userspace
+# define RGB_MATRIX_DEFAULT_MODE RGB_MATRIX_SOLID_COLOR
+# endif
+#endif
+
+#ifndef RGB_MATRIX_DEFAULT_HUE
+# define RGB_MATRIX_DEFAULT_HUE 0
+#endif
+
+#ifndef RGB_MATRIX_DEFAULT_SAT
+# define RGB_MATRIX_DEFAULT_SAT UINT8_MAX
+#endif
+
+#ifndef RGB_MATRIX_DEFAULT_VAL
+# define RGB_MATRIX_DEFAULT_VAL RGB_MATRIX_MAXIMUM_BRIGHTNESS
+#endif
+
+#ifndef RGB_MATRIX_DEFAULT_SPD
+# define RGB_MATRIX_DEFAULT_SPD UINT8_MAX / 2
+#endif
+
#ifndef RGB_MATRIX_LED_FLUSH_LIMIT
# define RGB_MATRIX_LED_FLUSH_LIMIT 16
#endif