- if (RGBLIGHT_EFFECT_KNIGHT_OFFSET) {
- for (i = 0; i < RGBLED_NUM; i++) {
- cur = (i + RGBLIGHT_EFFECT_KNIGHT_OFFSET) % RGBLED_NUM;
- led[i].r = preled[cur].r;
- led[i].g = preled[cur].g;
- led[i].b = preled[cur].b;
+ // Determine which LEDs should be lit up
+ for (i = 0; i < RGBLIGHT_EFFECT_KNIGHT_LED_NUM; i++) {
+ cur = (i + RGBLIGHT_EFFECT_KNIGHT_OFFSET) % RGBLED_NUM;
+
+ if (i >= low_bound && i <= high_bound) {
+ sethsv(rgblight_config.hue, rgblight_config.sat, rgblight_config.val, (LED_TYPE *)&led[cur]);
+ } else {
+ led[cur].r = 0;
+ led[cur].g = 0;
+ led[cur].b = 0;