From 346b06d391dbc760d753a5cffcbbcb58ecc9ce95 Mon Sep 17 00:00:00 2001 From: Less/Rikki <86894501+lesshonor@users.noreply.github.com> Date: Thu, 28 Sep 2023 06:51:18 -0400 Subject: 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 * refactor: remove INDICATOR_MAX_BRIGHTNESS macro Co-authored-by: Joel Challis --------- Co-authored-by: Joel Challis --- keyboards/zykrah/fuyu/keymaps/via/keymap.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'keyboards/zykrah/fuyu') diff --git a/keyboards/zykrah/fuyu/keymaps/via/keymap.c b/keyboards/zykrah/fuyu/keymaps/via/keymap.c index 1ad867731e..95eb2692cb 100644 --- a/keyboards/zykrah/fuyu/keymaps/via/keymap.c +++ b/keyboards/zykrah/fuyu/keymaps/via/keymap.c @@ -73,15 +73,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // Code for Caps Locks indicator #if defined(RGB_MATRIX_ENABLE) && defined(CAPS_LOCK_LED_INDEX) -#define CAPS_LOCK_MAX_BRIGHTNESS 0xFF -#ifdef RGB_MATRIX_MAXIMUM_BRIGHTNESS - #undef CAPS_LOCK_MAX_BRIGHTNESS +#if !defined(CAPS_LOCK_MAX_BRIGHTNESS) #define CAPS_LOCK_MAX_BRIGHTNESS RGB_MATRIX_MAXIMUM_BRIGHTNESS #endif -#define CAPS_LOCK_VAL_STEP 8 -#ifdef RGB_MATRIX_VAL_STEP - #undef CAPS_LOCK_VAL_STEP +#if !defined(CAPS_LOCK_VAL_STEP) #define CAPS_LOCK_VAL_STEP RGB_MATRIX_VAL_STEP #endif -- cgit v1.2.3