diff options
Diffstat (limited to 'keyboards/kprepublic/bm68hsrgb')
6 files changed, 20 insertions, 17 deletions
diff --git a/keyboards/kprepublic/bm68hsrgb/rev1/config.h b/keyboards/kprepublic/bm68hsrgb/rev1/config.h index 9b9d534c42..bf67620c5b 100644 --- a/keyboards/kprepublic/bm68hsrgb/rev1/config.h +++ b/keyboards/kprepublic/bm68hsrgb/rev1/config.h @@ -46,7 +46,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. // The pin connected to the data pin of the LEDs #define RGB_DI_PIN E2 // The number of LEDs connected -#define DRIVER_LED_TOTAL 74 +#define RGB_MATRIX_LED_COUNT 74 #ifdef RGB_DI_PIN # define RGBLED_NUM 74 # define RGB_MATRIX_KEYPRESSES // reacts to keypresses diff --git a/keyboards/kprepublic/bm68hsrgb/rev1/keymaps/peepeetee/config.h b/keyboards/kprepublic/bm68hsrgb/rev1/keymaps/peepeetee/config.h index 3ddb813486..eee7d2f9bf 100644 --- a/keyboards/kprepublic/bm68hsrgb/rev1/keymaps/peepeetee/config.h +++ b/keyboards/kprepublic/bm68hsrgb/rev1/keymaps/peepeetee/config.h @@ -53,7 +53,7 @@ // #define COMBO_COUNT 2 // Set this to the number of combos that you're using in the Combo feature. // #define COMBO_TERM 200 // How long for the Combo keys to be detected. Defaults to TAPPING_TERM if not defined. // #define TAP_CODE_DELAY 100 // Sets the delay between register_code and unregister_code, if you're having issues with it registering properly (common on VUSB boards). The value is in milliseconds. -// #define TAP_HOLD_CAPS_DELAY 80 // Sets the delay for Tap Hold keys (LT, MT) when using KC_CAPSLOCK keycode, as this has some special handling on MacOS. The value is in milliseconds, and defaults to 80 ms if not defined. For macOS, you may want to set this to 200 or higher. +// #define TAP_HOLD_CAPS_DELAY 80 // Sets the delay for Tap Hold keys (LT, MT) when using KC_CAPS_LOCK keycode, as this has some special handling on MacOS. The value is in milliseconds, and defaults to 80 ms if not defined. For macOS, you may want to set this to 200 or higher. #define RGB_MATRIX_FRAMEBUFFER_EFFECTS #define RGB_MATRIX_KEYPRESSES // reacts to keypresses @@ -62,9 +62,8 @@ // #define RGBLIGHT_HUE_STEP 12 // Units to step when in/decreasing hue // #define RGBLIGHT_SAT_STEP 25 // Units to step when in/decreasing saturation // #define RGBLIGHT_VAL_STEP 12 // Units to step when in/decreasing value (brightness) -// #define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects // #define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended -// #define RGB_MATRIX_LED_PROCESS_LIMIT (DRIVER_LED_TOTAL + 4) / 5 // limits the number of LEDs to process in an animation per task run (increases keyboard responsiveness) +// #define RGB_MATRIX_LED_PROCESS_LIMIT (RGB_MATRIX_LED_COUNT + 4) / 5 // limits the number of LEDs to process in an animation per task run (increases keyboard responsiveness) // #define RGB_MATRIX_LED_FLUSH_LIMIT 16 // limits in milliseconds how frequently an animation will update the LEDs. 16 (16ms) is equivalent to limiting to 60fps (increases keyboard responsiveness) // #define RGBLIGHT_ANIMATIONS // Run RGB animations // #define RGBLIGHT_ANIMATIONS // Enable all additional animation modes. diff --git a/keyboards/kprepublic/bm68hsrgb/rev1/keymaps/peepeetee/keymap.c b/keyboards/kprepublic/bm68hsrgb/rev1/keymaps/peepeetee/keymap.c index bf842b138b..a9bf663c19 100644 --- a/keyboards/kprepublic/bm68hsrgb/rev1/keymaps/peepeetee/keymap.c +++ b/keyboards/kprepublic/bm68hsrgb/rev1/keymaps/peepeetee/keymap.c @@ -56,7 +56,7 @@ Templete #undef _______ #define _______ {0, 0, 0} -const uint8_t PROGMEM ledmap[][DRIVER_LED_TOTAL][3] = { +const uint8_t PROGMEM ledmap[][RGB_MATRIX_LED_COUNT][3] = { [1] = { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, GREEN, BLUE, {0, 0, 255}, PURPLE, AZURE, _______, {0, 0, 255}, {0, 0, 255}, {0, 0, 255}, _______, _______, _______, _______, _______, _______, @@ -270,7 +270,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { void set_layer_color(int layer) { if (layer == 0) { return; } - for (int i = 0; i < DRIVER_LED_TOTAL; i++) { + for (int i = 0; i < RGB_MATRIX_LED_COUNT; i++) { HSV hsv = { .h = pgm_read_byte(&ledmap[layer][i][0]), .s = pgm_read_byte(&ledmap[layer][i][1]), @@ -288,7 +288,7 @@ void set_layer_color(int layer) { } } -void rgb_matrix_indicators_user(void) { +bool rgb_matrix_indicators_user(void) { led_t host_leds = host_keyboard_led_state(); if (host_leds.caps_lock) { @@ -300,4 +300,5 @@ void rgb_matrix_indicators_user(void) { } set_layer_color(get_highest_layer(layer_state)); + return false; } diff --git a/keyboards/kprepublic/bm68hsrgb/rev1/rev1.c b/keyboards/kprepublic/bm68hsrgb/rev1/rev1.c index 4634a662b6..78f4a15818 100644 --- a/keyboards/kprepublic/bm68hsrgb/rev1/rev1.c +++ b/keyboards/kprepublic/bm68hsrgb/rev1/rev1.c @@ -43,10 +43,13 @@ led_config_t g_led_config = { { } }; //CAPS backlight -__attribute__ ((weak)) -void rgb_matrix_indicators_user(void) { +bool rgb_matrix_indicators_kb(void) { + if (!rgb_matrix_indicators_user()) { + return false; + } if (host_keyboard_led_state().caps_lock) { rgb_matrix_set_color(30, 0xFF, 0xFF, 0xFF); } + return true; } #endif diff --git a/keyboards/kprepublic/bm68hsrgb/rev2/config.h b/keyboards/kprepublic/bm68hsrgb/rev2/config.h index 86fbb7ae3b..3921aa17cc 100644 --- a/keyboards/kprepublic/bm68hsrgb/rev2/config.h +++ b/keyboards/kprepublic/bm68hsrgb/rev2/config.h @@ -55,12 +55,11 @@ #define DRIVER_COUNT 1 #define DRIVER_1_LED_TOTAL 68 -#define DRIVER_LED_TOTAL DRIVER_1_LED_TOTAL +#define RGB_MATRIX_LED_COUNT DRIVER_1_LED_TOTAL #define DRIVER_INDICATOR_LED_TOTAL 0 #ifdef RGB_MATRIX_ENABLE -#define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects #define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended #define RGB_MATRIX_KEYPRESSES diff --git a/keyboards/kprepublic/bm68hsrgb/rev2/rev2.c b/keyboards/kprepublic/bm68hsrgb/rev2/rev2.c index be743cbae5..4a13d037d6 100644 --- a/keyboards/kprepublic/bm68hsrgb/rev2/rev2.c +++ b/keyboards/kprepublic/bm68hsrgb/rev2/rev2.c @@ -17,7 +17,7 @@ #ifdef RGB_MATRIX_ENABLE -const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { +const is31_led g_is31_leds[RGB_MATRIX_LED_COUNT] = { {0, CS6_SW1, CS5_SW1, CS4_SW1}, {0, CS6_SW2, CS5_SW2, CS4_SW2}, {0, CS6_SW3, CS5_SW3, CS4_SW3}, @@ -113,12 +113,13 @@ led_config_t g_led_config = { { } }; -__attribute__ ((weak)) -void rgb_matrix_indicators_user(void) -{ - if (host_keyboard_led_state().caps_lock) - { +bool rgb_matrix_indicators_kb(void) { + if (!rgb_matrix_indicators_user()) { + return false; + } + if (host_keyboard_led_state().caps_lock) { rgb_matrix_set_color(30, 0xFF, 0xFF, 0xFF); } + return true; } #endif |