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>
This commit is contained in:
@@ -5,7 +5,8 @@
|
||||
"device_version": "0.0.3"
|
||||
},
|
||||
"rgb_matrix": {
|
||||
"driver": "is31fl3741"
|
||||
"driver": "is31fl3741",
|
||||
"val_steps": 8
|
||||
},
|
||||
"matrix_pins": {
|
||||
"cols": ["F7", "F6", "F5", "C7", "B0", "B1", "B2", "B3", "B4", "D7", "D6", "D4", "D5", "D3", "D2"],
|
||||
|
||||
@@ -125,16 +125,12 @@ led_config_t g_led_config = { {
|
||||
|
||||
#if defined(RGB_MATRIX_ENABLE) && defined(CAPS_LOCK_LED_INDEX)
|
||||
|
||||
#ifdef RGB_MATRIX_MAXIMUM_BRIGHTNESS
|
||||
#if !defined(CAPS_LOCK_MAX_BRIGHTNESS)
|
||||
#define CAPS_LOCK_MAX_BRIGHTNESS RGB_MATRIX_MAXIMUM_BRIGHTNESS
|
||||
#else
|
||||
#define CAPS_LOCK_MAX_BRIGHTNESS 0xFF
|
||||
#endif
|
||||
|
||||
#ifdef RGB_MATRIX_VAL_STEP
|
||||
#if !defined(CAPS_LOCK_VAL_STEP)
|
||||
#define CAPS_LOCK_VAL_STEP RGB_MATRIX_VAL_STEP
|
||||
#else
|
||||
#define CAPS_LOCK_VAL_STEP 8
|
||||
#endif
|
||||
|
||||
bool rgb_matrix_indicators_kb(void) {
|
||||
|
||||
Reference in New Issue
Block a user