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:
parent
f4677c866e
commit
346b06d391
18 changed files with 103 additions and 138 deletions
|
@ -634,11 +634,6 @@ void via_qmk_rgblight_save(void) {
|
|||
|
||||
#if defined(RGB_MATRIX_ENABLE)
|
||||
|
||||
# if !defined(RGB_MATRIX_MAXIMUM_BRIGHTNESS) || RGB_MATRIX_MAXIMUM_BRIGHTNESS > UINT8_MAX
|
||||
# undef RGB_MATRIX_MAXIMUM_BRIGHTNESS
|
||||
# define RGB_MATRIX_MAXIMUM_BRIGHTNESS UINT8_MAX
|
||||
# endif
|
||||
|
||||
void via_qmk_rgb_matrix_command(uint8_t *data, uint8_t length) {
|
||||
// data = [ command_id, channel_id, value_id, value_data ]
|
||||
uint8_t *command_id = &(data[0]);
|
||||
|
@ -727,11 +722,6 @@ void via_qmk_rgb_matrix_save(void) {
|
|||
|
||||
#if defined(LED_MATRIX_ENABLE)
|
||||
|
||||
# if !defined(LED_MATRIX_MAXIMUM_BRIGHTNESS) || LED_MATRIX_MAXIMUM_BRIGHTNESS > UINT8_MAX
|
||||
# undef LED_MATRIX_MAXIMUM_BRIGHTNESS
|
||||
# define LED_MATRIX_MAXIMUM_BRIGHTNESS UINT8_MAX
|
||||
# endif
|
||||
|
||||
void via_qmk_led_matrix_command(uint8_t *data, uint8_t length) {
|
||||
// data = [ command_id, channel_id, value_id, value_data ]
|
||||
uint8_t *command_id = &(data[0]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue