aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/feature_rgblight.md130
-rw-r--r--docs/gitbook/images/color-wheel.svg441
-rw-r--r--keyboards/clueboard/keymaps/default/keymap.c4
-rw-r--r--keyboards/clueboard/rev2/config.h11
-rw-r--r--quantum/quantum.c158
-rw-r--r--quantum/quantum_keycodes.h16
-rw-r--r--quantum/rgblight.c24
-rw-r--r--quantum/rgblight.h10
8 files changed, 699 insertions, 95 deletions
diff --git a/docs/feature_rgblight.md b/docs/feature_rgblight.md
index 7f12155cb..e7b1bb9d2 100644
--- a/docs/feature_rgblight.md
+++ b/docs/feature_rgblight.md
@@ -1,8 +1,107 @@
1# RGB Lighting 1# RGB Lighting
2 2
3<!-- FIXME: Describe how to use RGB Lighting here. --> 3If you've installed addressable RGB lights on your keyboard you can control them with QMK. Currently we support the following addressable LEDs on Atmel AVR processors:
4 4
5## RGB Under Glow Mod 5* WS2811 and variants (WS2812, WS2812B, WS2812C, etc)
6* SK6812RGBW
7
8Some keyboards come with RGB LEDs pre-installed. Others have to have LEDs installed after the fact. See below for information on modifying your keyboard.
9
10## Selecting Colors
11
12QMK uses Hue, Saturation, and Value to set color rather than using RGB. You can use the color wheel below to see how this works. Changing the Hue will cycle around the circle. Saturation will affect the intensity of the color, which you can see as you move from the inner part to the outer part of the wheel. Value sets the overall brightness.
13
14![gitbook/images/color-wheel.svg]
15
16If you would like to learn more about HSV you can start with the [wikipedia article](https://en.wikipedia.org/wiki/HSL_and_HSV).
17
18## Configuration
19
20Before RGB Lighting can be used you have to enable it in `rules.mk`:
21
22 RGBLIGHT_ENABLE = yes
23
24You can configure the behavior of the RGB lighting by defining values inside `config.h`.
25
26### Required Configuration
27
28At minimum you have to define the pin your LED strip is connected to and the number of LEDs connected.
29
30```c
31#define RGB_DI_PIN D7 // The pin the LED strip is connected to
32#define RGBLED_NUM 14 // Number of LEDs in your strip
33```
34
35### Optional Configuration
36
37You can change the behavior of the RGB Lighting by setting these configuration values. Use `#define <Option> <Value>` in a `config.h` at the keyboard, revision, or keymap level.
38
39| Option | Default Value | Description |
40|--------|---------------|-------------|
41| `RGBLIGHT_HUE_STEP` | 10 | How many hues you want to have available. |
42| `RGBLIGHT_SAT_STEP` | 17 | How many steps of saturation you'd like. |
43| `RGBLIGHT_VAL_STEP` | 17 | The number of levels of brightness you want. |
44
45### Animations
46
47If you have `#define RGBLIGHT_ANIMATIONS` in your `config.h` you will have a number of animation modes you can cycle through using the `RGB_MOD` key. You can also `#define` other options to tweak certain animations.
48
49| Option | Default Value | Description |
50|--------|---------------|-------------|
51| `RGBLIGHT_ANIMATIONS` | | `#define` this to enable animation modes. |
52| `RGBLIGHT_EFFECT_SNAKE_LENGTH` | 4 | The number of LEDs to light up for the "snake" mode. |
53| `RGBLIGHT_EFFECT_KNIGHT_LENGTH` | 3 | The number of LEDs to light up for the "knight" mode. |
54| `RGBLIGHT_EFFECT_KNIGHT_OFFSET` | 0 | Start the knight animation this many LEDs from the start of the strip. |
55| `RGBLIGHT_EFFECT_KNIGHT_LED_NUM` | RGBLED_NUM | The number of LEDs to have the "knight" animation travel. |
56| `RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL` | 1000 | How long to wait between light changes for the "christmas" animation. Specified in ms. |
57| `RGBLIGHT_EFFECT_CHRISTMAS_STEP` | 2 | How many LED's to group the red/green colors by for the christmas mode. |
58
59You can also tweak the behavior of the animations by defining these consts in your `keymap.c`. These mostly affect the speed different modes animate at.
60
61```c
62// How long (in ms) to wait between animation steps for the breathing mode
63const uint8_t RGBLED_BREATHING_INTERVALS[] PROGMEM = {30, 20, 10, 5};
64
65// How long (in ms) to wait between animation steps for the rainbow mode
66const uint8_t RGBLED_RAINBOW_MOOD_INTERVALS[] PROGMEM = {120, 60, 30};
67
68// How long (in ms) to wait between animation steps for the swirl mode
69const uint8_t RGBLED_RAINBOW_SWIRL_INTERVALS[] PROGMEM = {100, 50, 20};
70
71// How long (in ms) to wait between animation steps for the snake mode
72const uint8_t RGBLED_SNAKE_INTERVALS[] PROGMEM = {100, 50, 20};
73
74// How long (in ms) to wait between animation steps for the knight modes
75const uint8_t RGBLED_KNIGHT_INTERVALS[] PROGMEM = {127, 63, 31};
76
77// These control which colors are selected for the gradient mode
78const uint16_t RGBLED_GRADIENT_RANGES[] PROGMEM = {360, 240, 180, 120, 90};
79```
80
81## RGB Lighting Keycodes
82
83These control the RGB Lighting functionality.
84
85| Long Name | Short Name | Description |
86|-----------|------------|-------------|
87||`RGB_TOG`|toggle on/off|
88||`RGB_MOD`|cycle through modes|
89||`RGB_HUI`|hue increase|
90||`RGB_HUD`|hue decrease|
91||`RGB_SAI`|saturation increase|
92||`RGB_SAD`|saturation decrease|
93||`RGB_VAI`|value (brightness) increase|
94||`RGB_VAD`|value (brightness) decrease|
95|`RGB_MODE_PLAIN`|`RGB_M_P `| Switch to the static no animation mode |
96|`RGB_MODE_BREATHE`|`RGB_M_B`| Switch to the breathing mode |
97|`RGB_MODE_RAINBOW`|`RGB_M_R`| Switch to the rainbow mode ||
98|`RGB_MODE_SWIRL`|`RGB_M_SW`| Switch to the swirl mode |
99|`RGB_MODE_SNAKE`|`RGB_M_SN`| Switch to the snake mode |
100|`RGB_MODE_KNIGHT`|`RGB_M_K`| Switch to the knight animation |
101|`RGB_MODE_XMAS`|`RGB_M_X`| Switch to the Christmas animation |
102|`RGB_MODE_GRADIENT`|`RGB_M_G`| Switch to the static gradient mode |
103
104## Hardware Modification
6 105
7![Planck with RGB Underglow](https://raw.githubusercontent.com/qmk/qmk_firmware/master/keyboards/planck/keymaps/yang/planck-with-rgb-underglow.jpg) 106![Planck with RGB Underglow](https://raw.githubusercontent.com/qmk/qmk_firmware/master/keyboards/planck/keymaps/yang/planck-with-rgb-underglow.jpg)
8 107
@@ -17,33 +116,6 @@ In order to use the underglow animation functions, you need to have `#define RGB
17Please add the following options into your config.h, and set them up according your hardware configuration. These settings are for the `F4` pin by default: 116Please add the following options into your config.h, and set them up according your hardware configuration. These settings are for the `F4` pin by default:
18 117
19 #define RGB_DI_PIN F4 // The pin your RGB strip is wired to 118 #define RGB_DI_PIN F4 // The pin your RGB strip is wired to
20 #define RGBLIGHT_ANIMATIONS // Require for fancier stuff (not compatible with audio)
21 #define RGBLED_NUM 14 // Number of LEDs 119 #define RGBLED_NUM 14 // Number of LEDs
22 #define RGBLIGHT_HUE_STEP 10
23 #define RGBLIGHT_SAT_STEP 17
24 #define RGBLIGHT_VAL_STEP 17
25 120
26You'll need to edit `RGB_DI_PIN` to the pin you have your `DI` on your RGB strip wired to. 121You'll need to edit `RGB_DI_PIN` to the pin you have your `DI` on your RGB strip wired to.
27
28The firmware supports 5 different light effects, and the color (hue, saturation, brightness) can be customized in most effects. To control the underglow, you need to modify your keymap file to assign those functions to some keys/key combinations. For details, please check this keymap. `keyboards/planck/keymaps/yang/keymap.c`
29
30### WS2812 Wiring
31
32![WS2812 Wiring](https://raw.githubusercontent.com/qmk/qmk_firmware/master/keyboards/planck/keymaps/yang/WS2812-wiring.jpg)
33
34Please note the USB port can only supply a limited amount of power to the keyboard (500mA by standard, however, modern computer and most usb hubs can provide 700+mA.). According to the data of NeoPixel from Adafruit, 30 WS2812 LEDs require a 5V 1A power supply, LEDs used in this mod should not more than 20.
35
36## RGB Lighting Keycodes
37
38This controls the RGB Lighting functionality. Most keyboards use WS2812 (and compatible) LEDs for underlight or case lighting.
39
40|Name|Description|
41|----|-----------|
42|`RGB_TOG`|toggle on/off|
43|`RGB_MOD`|cycle through modes|
44|`RGB_HUI`|hue increase|
45|`RGB_HUD`|hue decrease|
46|`RGB_SAI`|saturation increase|
47|`RGB_SAD`|saturation decrease|
48|`RGB_VAI`|value increase|
49|`RGB_VAD`|value decrease|
diff --git a/docs/gitbook/images/color-wheel.svg b/docs/gitbook/images/color-wheel.svg
new file mode 100644
index 000000000..83e599477
--- /dev/null
+++ b/docs/gitbook/images/color-wheel.svg
@@ -0,0 +1,441 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3<svg
4 xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
5 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
6 xmlns="http://www.w3.org/2000/svg"
7 xmlns:dc="http://purl.org/dc/elements/1.1/"
8 xmlns:ns1="http://sozi.baierouge.fr"
9 xmlns:cc="http://web.resource.org/cc/"
10 xmlns:xlink="http://www.w3.org/1999/xlink"
11 xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
12 id="Layer_1"
13 enable-background="new 0 0 360 360"
14 xml:space="preserve"
15 viewBox="0 0 360 360"
16 version="1.1"
17 y="0px"
18 x="0px"
19 >
20<g
21 >
22</g
23 >
24<g
25 >
26 <g
27 >
28 <path
29 d="m193.8 167.46l113.52-113.89c-23.457-23.36-50.2-38.727-82.193-47.23l-41.313 155.45c3.15 0.84 7.66 3.37 9.98 5.67z"
30 fill="#E0C3D3"
31 />
32 <path
33 d="m209.95 151.26l97.367-97.688c-23.457-23.36-50.2-38.727-82.193-47.23l-35.43 133.29c7.71 1.86 14.76 5.91 20.25 11.63z"
34 fill="#E0A0C3"
35 />
36 <path
37 d="m225.94 135.21l81.375-81.643c-23.457-23.36-50.2-38.727-82.193-47.23l-29.61 111.4c11.55 2.89 22.11 8.95 30.42 17.47z"
38 fill="#E080B5"
39 />
40 <path
41 d="m241.95 119.15l65.369-65.585c-23.457-23.36-50.2-38.727-82.193-47.23l-23.784 89.491c15.38 3.919 29.46 12.004 40.6 23.324z"
42 fill="#E061A7"
43 />
44 <path
45 d="m257.95 103.1l49.371-49.533c-23.457-23.36-50.2-38.727-82.193-47.23l-17.962 67.589c19.22 4.944 36.82 15.052 50.78 29.174z"
46 fill="#E04198"
47 />
48 <path
49 d="m273.95 87.05l33.373-33.482c-23.457-23.36-50.2-38.727-82.193-47.23l-12.142 45.687c23.07 5.968 44.18 18.099 60.96 35.025z"
50 fill="#E0228B"
51 />
52 <path
53 d="m289.94 70.999l17.375-17.431c-23.457-23.36-50.2-38.728-82.193-47.231l-6.321 23.784c26.91 6.994 51.54 21.148 71.13 40.878z"
54 fill="#E10071"
55 />
56 </g
57 >
58 <g
59 >
60 <path
61 d="m174.73 162.13c2.934-0.792 6.094-0.876 8.876-0.292l41-155.36c-31.994-8.502-61.625-8.332-93.483 0.274l42.101 155.85c-0.01-0.02 1.13-0.37 1.5-0.47z"
62 fill="#FFD9D9"
63 />
64 <path
65 d="m168.93 139.99c6.926-1.871 14.036-1.906 20.556-0.349l35.12-133.16c-31.994-8.502-61.625-8.332-93.483 0.274l36.127 133.73c0.95-0.27 1.19-0.36 1.67-0.49z"
66 fill="#FFB6B6"
67 />
68 <path
69 d="m163.03 118.12c10.904-2.946 22.03-2.917 32.267-0.373l29.31-111.27c-31.994-8.502-61.625-8.332-93.483 0.274l30.218 111.86c0.96-0.27 1.19-0.36 1.68-0.49z"
70 fill="#FF8F8F"
71 />
72 <path
73 d="m157.12 96.243c14.884-4.021 30.029-3.944 43.982-0.413l23.51-89.354c-31.994-8.502-61.625-8.332-93.483 0.274l24.304 89.968c0.96-0.268 1.2-0.344 1.69-0.475z"
74 fill="#FF6E6E"
75 />
76 <path
77 d="m151.21 74.369c18.863-5.096 38.024-4.964 55.695-0.446l17.71-67.447c-31.994-8.502-61.625-8.332-93.483 0.274l18.395 68.094c0.96-0.267 1.2-0.344 1.69-0.475z"
78 fill="#FF4848"
79 />
80 <path
81 d="m145.06 52.56c22.919-6.191 46.298-6.016 67.745-0.456l11.81-45.628c-31.994-8.502-61.625-8.332-93.483 0.274l12.484 46.214c0.97-0.263 1.13-0.317 1.45-0.404z"
82 fill="#FF2424"
83 />
84 <path
85 d="m139.15 30.685c26.906-7.269 54.312-7.036 79.48-0.483l5.978-23.726c-31.994-8.502-61.625-8.332-93.483 0.274l6.575 24.34c0.97-0.262 1.13-0.318 1.45-0.405z"
86 fill="#FF0000"
87 />
88 </g
89 >
90 <g
91 >
92 <path
93 d="m173.23 162.6l-42.1-155.85c-31.858 8.606-56.824 23.185-80.185 46.64l114.57 114.36c2.08-2.33 4.86-4.17 7.71-5.15z"
94 fill="#FFEBD9"
95 />
96 <path
97 d="m167.25 140.48l-36.12-133.73c-31.858 8.606-56.824 23.185-80.185 46.64l98.442 98.288c4.77-5.09 11.17-9.11 17.86-11.2z"
98 fill="#FFD7B3"
99 />
100 <path
101 d="m161.34 118.61l-30.21-111.86c-31.858 8.606-56.824 23.185-80.185 46.64l82.386 82.283c7.49-7.82 17.47-13.93 28.01-17.06z"
102 fill="#FFC48F"
103 />
104 <path
105 d="m155.43 96.719l-24.3-89.969c-31.858 8.606-56.824 23.185-80.185 46.64l66.336 66.282c10.2-10.55 23.74-18.78 38.15-22.951z"
106 fill="#FFB26C"
107 />
108 <path
109 d="m149.52 74.845l-18.39-68.095c-31.858 8.606-56.824 23.185-80.185 46.64l50.287 50.283c12.91-13.273 30.02-23.612 48.29-28.825z"
110 fill="#FF9F48"
111 />
112 <path
113 d="m143.61 52.964l-12.48-46.214c-31.858 8.606-56.824 23.185-80.185 46.64l34.05 34.204c15.705-16.028 35.495-28.198 58.615-34.63z"
114 fill="#FF8C24"
115 />
116 <path
117 d="m137.7 31.091l-6.575-24.34c-31.858 8.606-56.824 23.185-80.185 46.64l17.99 18.216c18.435-18.762 41.795-33.041 68.775-40.516z"
118 fill="#FF8000"
119 />
120 </g
121 >
122 <g
123 >
124 <path
125 d="m166.24 167.56l-114.82-114.3c-23.36 23.457-36.884 48.514-45.386 80.507l155.98 41.453c0.85-3.15 1.92-5.35 4.23-7.66z"
126 fill="#FFFED9"
127 />
128 <path
129 d="m149.96 151.35l-98.535-98.09c-23.36 23.457-36.884 48.514-45.386 80.507l133.85 35.573c1.8-6.74 5.26-12.94 10.07-17.99z"
130 fill="#FFFDB3"
131 />
132 <path
133 d="m133.9 135.37l-82.475-82.11c-23.36 23.457-36.884 48.514-45.386 80.507l111.95 29.753c2.82-10.58 8.31-20.29 15.91-28.15z"
134 fill="#FFFC8F"
135 />
136 <path
137 d="m117.84 119.37l-66.415-66.11c-23.36 23.457-36.884 48.514-45.386 80.507l90.037 23.929c3.845-14.42 11.364-27.64 21.764-38.33z"
138 fill="#FFFB6C"
139 />
140 <path
141 d="m101.78 103.39l-50.355-50.13c-23.36 23.457-36.884 48.514-45.386 80.507l68.136 18.108c4.869-18.26 14.403-34.99 27.605-48.49z"
142 fill="#FFFA48"
143 />
144 <path
145 d="m85.716 87.398l-34.291-34.138c-23.36 23.457-36.884 48.514-45.386 80.507l46.235 12.288c5.893-22.09 17.445-42.34 33.442-58.662z"
146 fill="#FFF924"
147 />
148 <path
149 d="m69.657 71.411l-18.232-18.151c-23.36 23.457-36.884 48.514-45.386 80.507l24.334 6.468c6.917-25.93 20.488-49.694 39.284-68.829z"
150 fill="#FFFF00"
151 />
152 </g
153 >
154 <g
155 >
156 <path
157 d="m162.13 185.27c-0.792-2.934-0.647-7.06-0.061-9.842l-155.89-41.15c-8.503 31.994-8.034 62.733 0.572 94.591l155.85-42.1c-0.02 0.01-0.37-1.13-0.47-1.5z"
158 fill="#EBFFD9"
159 />
160 <path
161 d="m139.99 191.07c-1.963-7.268-1.891-14.725-0.095-21.517l-133.72-35.27c-8.503 31.994-8.034 62.733 0.572 94.591l133.73-36.127c-0.27-0.96-0.36-1.19-0.49-1.67z"
162 fill="#D8FFB6"
163 />
164 <path
165 d="m118.12 196.98c-3.039-11.249-2.905-22.722-0.121-33.231l-111.82-29.47c-8.503 31.994-8.034 62.733 0.572 94.591l111.86-30.218c-0.27-0.96-0.36-1.19-0.49-1.67z"
166 fill="#C5FF92"
167 />
168 <path
169 d="m96.244 202.89c-4.114-15.228-3.942-30.725-0.169-44.949l-89.897-23.66c-8.503 31.994-8.034 62.733 0.572 94.591l89.968-24.304c-0.268-0.97-0.343-1.2-0.474-1.68z"
170 fill="#B1FF6C"
171 />
172 <path
173 d="m74.371 208.8c-5.189-19.208-4.962-38.724-0.201-56.666l-67.992-17.85c-8.503 31.994-8.034 62.733 0.572 94.591l68.094-18.395c-0.267-0.96-0.343-1.2-0.473-1.68z"
174 fill="#9DFF48"
175 />
176 <path
177 d="m52.563 214.95c-6.285-23.265-6.011-46.996-0.205-68.714l-46.18-11.96c-8.503 31.994-8.034 62.733 0.572 94.591l46.214-12.484c-0.263-0.97-0.315-1.12-0.401-1.44z"
178 fill="#8AFF24"
179 />
180 <path
181 d="m30.688 220.86c-7.362-27.251-7.029-55.011-0.229-80.452l-24.28-6.125c-8.503 31.994-8.034 62.733 0.572 94.591l24.34-6.575c-0.264-0.97-0.317-1.12-0.403-1.44z"
182 fill="#71FF00"
183 />
184 </g
185 >
186 <g
187 >
188 <path
189 d="m162.6 186.77l-155.85 42.1c8.606 31.857 23.185 56.824 46.641 80.185l114.36-114.57c-2.33-2.09-4.17-4.87-5.15-7.72z"
190 fill="#DCFFDC"
191 />
192 <path
193 d="m140.48 192.75l-133.73 36.12c8.606 31.857 23.185 56.824 46.641 80.185l98.286-98.442c-5.1-4.78-9.11-11.18-11.2-17.87z"
194 fill="#B6FFB6"
195 />
196 <path
197 d="m118.61 198.66l-111.86 30.21c8.606 31.857 23.185 56.824 46.641 80.185l82.281-82.387c-7.82-7.49-13.93-17.47-17.06-28.01z"
198 fill="#92FF92"
199 />
200 <path
201 d="m96.719 204.57l-89.969 24.3c8.606 31.857 23.185 56.824 46.641 80.185l66.28-66.336c-10.55-10.2-18.78-23.74-22.951-38.15z"
202 fill="#6EFF6E"
203 />
204 <path
205 d="m74.845 210.48l-68.095 18.39c8.606 31.857 23.185 56.824 46.641 80.185l50.281-50.287c-13.274-12.92-23.614-30.02-28.825-48.29z"
206 fill="#4AFF4A"
207 />
208 <path
209 d="m52.964 216.39l-46.214 12.48c8.606 31.857 23.185 56.824 46.641 80.185l34.202-34.049c-16.028-15.71-28.198-35.5-34.629-58.62z"
210 fill="#27FF27"
211 />
212 <path
213 d="m31.091 222.3l-24.34 6.575c8.606 31.857 23.185 56.824 46.641 80.185l18.214-17.989c-18.763-18.43-33.043-41.79-40.515-68.77z"
214 fill="#00FF00"
215 />
216 </g
217 >
218 <g
219 >
220 <path
221 d="m167.59 193.87l-114.31 114.78c23.455 23.359 47.388 37.112 79.381 45.616l41.606-156.55c-3.16-0.85-4.37-1.55-6.68-3.85z"
222 fill="#DCFFED"
223 />
224 <path
225 d="m151.42 210.11l-98.14 98.54c23.455 23.359 47.388 37.112 79.381 45.616l35.721-134.41c-6.34-1.86-12.17-5.21-16.96-9.75z"
226 fill="#B6FFD9"
227 />
228 <path
229 d="m135.43 226.16l-82.15 82.49c23.455 23.359 47.388 37.112 79.381 45.616l29.9-112.51c-10.18-2.89-19.52-8.26-27.13-15.6z"
230 fill="#92FFC6"
231 />
232 <path
233 d="m119.43 242.22l-66.15 66.43c23.456 23.359 47.388 37.112 79.381 45.616l24.079-90.603c-14.02-3.92-26.87-11.31-37.31-21.45z"
234 fill="#6EFFB3"
235 />
236 <path
237 d="m103.44 258.28l-50.16 50.37c23.455 23.359 47.388 37.112 79.381 45.616l18.258-68.701c-17.86-4.95-34.22-14.35-47.48-27.29z"
238 fill="#4AFFA0"
239 />
240 <path
241 d="m87.451 274.34l-34.17 34.31c23.455 23.359 47.388 37.112 79.381 45.616l12.438-46.801c-21.69-5.97-41.58-17.4-57.649-33.13z"
242 fill="#27FF8D"
243 />
244 <path
245 d="m71.459 290.39l-18.179 18.26c23.455 23.359 47.388 37.112 79.381 45.616l6.618-24.9c-25.53-6.99-48.93-20.44-67.821-38.98z"
246 fill="#00FF80"
247 />
248 </g
249 >
250 <g
251 >
252 <path
253 d="m173.85 197.82l-41.812 156.61c31.993 8.501 61.11 8.47 92.969-0.136l-42.101-155.85c-2.95 0.59-6.08 0.35-9.06-0.62z"
254 fill="#DCFFFE"
255 />
256 <path
257 d="m167.98 219.87l-35.941 134.56c31.993 8.501 61.11 8.47 92.969-0.136l-36.127-133.73c-6.82 1.57-14.22 1.29-20.9-0.69z"
258 fill="#B6FFFD"
259 />
260 <path
261 d="m162.15 241.77l-30.107 112.65c31.993 8.501 61.11 8.47 92.969-0.136l-30.219-111.86c-10.69 2.62-22.24 2.33-32.64-0.65z"
262 fill="#92FFFC"
263 />
264 <path
265 d="m156.32 263.68l-24.276 90.754c31.993 8.501 61.11 8.47 92.969-0.136l-24.305-89.969c-14.54 3.66-30.26 3.33-44.38-0.64z"
266 fill="#6EFFFB"
267 />
268 <path
269 d="m150.49 285.57l-18.446 68.856c31.993 8.501 61.11 8.47 92.969-0.136l-18.396-68.095c-18.41 4.7-38.28 4.34-56.12-0.63z"
270 fill="#4AFFFA"
271 />
272 <path
273 d="m144.7 307.61l-12.655 46.815c31.993 8.501 61.11 8.47 92.969-0.136l-12.484-46.215c-23.22 6.1-46.19 5.49-67.83-0.45z"
274 fill="#27FFF9"
275 />
276 <path
277 d="m138.88 329.52l-6.839 24.913c31.994 8.501 61.11 8.47 92.969-0.136l-6.575-24.341c-27.08 7.13-54.2 6.49-79.56-0.43z"
278 fill="#00FFFF"
279 />
280 </g
281 >
282 <g
283 >
284 <path
285 d="m192.47 193.82c-2.109 1.906-5.088 3.48-8.022 4.273-0.373 0.101-1.527 0.377-1.533 0.354l42.101 155.85c31.857-8.606 57.647-23.407 81.009-46.862l-113.56-113.61z"
286 fill="#DCEFFF"
287 />
288 <path
289 d="m208.69 210.01c-4.857 4.652-11.156 8.255-18.107 10.133-0.485 0.131-0.729 0.176-1.699 0.42l36.127 133.73c31.857-8.606 57.647-23.407 81.009-46.862l-97.33-97.42z"
290 fill="#B6DEFF"
291 />
292 <path
293 d="m224.73 226.01c-7.572 7.374-17.307 13.052-28.233 16.004-0.486 0.131-0.732 0.17-1.701 0.42l30.219 111.86c31.857-8.606 57.647-23.407 81.009-46.862l-81.3-81.42z"
294 fill="#92CEFF"
295 />
296 <path
297 d="m240.78 242.02c-10.285 10.097-23.467 17.838-38.372 21.864-0.484 0.131-0.729 0.186-1.696 0.438l24.305 89.969c31.857-8.606 57.647-23.407 81.009-46.862l-65.25-65.41z"
298 fill="#6EBEFF"
299 />
300 <path
301 d="m208.31 285.76c-0.485 0.132-0.731 0.185-1.698 0.439l18.396 68.095c31.857-8.606 57.647-23.407 81.009-46.862l-49.444-49.336c-13 12.81-29.38 22.56-48.27 27.66z"
302 fill="#4AADFF"
303 />
304 <path
305 d="m213.98 307.7c-0.324 0.088-0.49 0.122-1.456 0.38l12.484 46.215c31.857-8.606 57.647-23.407 81.009-46.862l-33.533-33.371c-15.72 15.59-35.58 27.44-58.5 33.63z"
306 fill="#279EFF"
307 />
308 <path
309 d="m219.89 329.57c-0.325 0.088-0.491 0.121-1.457 0.38l6.575 24.341c31.857-8.606 57.647-23.407 81.009-46.862l-17.47-17.385c-18.43 18.34-41.75 32.27-68.65 39.53z"
310 fill="#0080FF"
311 />
312 </g
313 >
314 <g
315 >
316 <path
317 d="m197.71 185.73c-0.843 3.153-2.941 5.768-5.242 8.083l113.97 113.5c23.359-23.456 39.325-47.987 47.829-79.98l-156.56-41.6z"
318 fill="#DCDCFF"
319 />
320 <path
321 d="m219.85 191.62c-2.041 6.976-5.889 13.329-11.148 18.372l97.727 97.328c23.359-23.456 39.325-47.987 47.829-79.98l-134.41-35.72z"
322 fill="#B6B6FF"
323 />
324 <path
325 d="m241.75 197.44c-3.064 10.814-8.936 20.677-16.995 28.538l81.675 81.342c23.359-23.456 39.325-47.987 47.829-79.98l-112.52-29.9z"
326 fill="#9292FF"
327 />
328 <path
329 d="m263.66 203.26c-4.089 14.652-11.976 28.037-22.837 38.716l65.61 65.343c23.359-23.456 39.325-47.987 47.829-79.98l-90.6-24.08z"
330 fill="#6E6EFF"
331 />
332 <path
333 d="m285.56 209.08c-5.112 18.491-15.019 35.392-28.682 48.887l49.554 49.352c23.359-23.456 39.325-47.987 47.829-79.98l-68.7-18.26z"
334 fill="#4A4AFF"
335 />
336 <path
337 d="m307.46 214.9c-6.137 22.329-18.063 42.745-34.525 59.06l33.496 33.358c23.359-23.456 39.325-47.987 47.829-79.98l-46.81-12.44z"
338 fill="#2727FF"
339 />
340 <path
341 d="m329.36 220.72c-7.161 26.167-21.104 50.1-40.368 69.23l17.438 17.366c23.359-23.456 39.325-47.987 47.829-79.98l-24.9-6.62z"
342 fill="#0000FF"
343 />
344 </g
345 >
346 <g
347 >
348 <path
349 d="m198.44 177.09c0.588 2.949 0.342 6.08-0.624 9.056l156.61 41.813c8.501-31.994 8.47-61.111-0.136-92.969l-155.85 42.1z"
350 fill="#ECDCFF"
351 />
352 <path
353 d="m220.56 171.12c1.57 6.827 1.293 14.228-0.688 20.901l134.56 35.941c8.501-31.994 8.47-61.111-0.136-92.969l-133.73 36.13z"
354 fill="#D8B6FF"
355 />
356 <path
357 d="m242.43 165.21c2.612 10.689 2.32 22.245-0.657 32.643l112.65 30.108c8.501-31.994 8.47-61.111-0.136-92.969l-111.85 30.22z"
358 fill="#C492FF"
359 />
360 <path
361 d="m264.32 159.29c3.655 14.55 3.324 30.265-0.649 44.388l90.754 24.277c8.501-31.994 8.47-61.111-0.136-92.969l-89.96 24.3z"
362 fill="#B16EFF"
363 />
364 <path
365 d="m286.2 153.38c4.699 18.412 4.345 38.281-0.625 56.128l68.855 18.446c8.501-31.994 8.47-61.111-0.136-92.969l-68.1 18.39z"
366 fill="#9E4AFF"
367 />
368 <path
369 d="m308.08 147.47c6.088 23.216 5.471 46.185-0.464 67.83l46.814 12.655c8.501-31.994 8.47-61.111-0.136-92.969l-46.21 12.48z"
370 fill="#8B27FF"
371 />
372 <path
373 d="m329.95 141.56c7.131 27.078 6.49 54.192-0.435 79.554l24.911 6.84c8.501-31.994 8.47-61.111-0.136-92.969l-24.34 6.58z"
374 fill="#8000FF"
375 />
376 </g
377 >
378 <g
379 >
380 <path
381 d="m198.09 175.56c0.101 0.374 0.377 1.528 0.354 1.534l155.85-42.101c-8.606-31.858-23.408-57.649-46.862-81.009l-113.63 113.48c1.9 2.11 3.5 5.16 4.29 8.1z"
382 fill="#FEDCFF"
383 />
384 <path
385 d="m220.14 169.42c0.131 0.486 0.176 0.729 0.42 1.699l133.73-36.126c-8.606-31.858-23.407-57.648-46.862-81.009l-97.479 97.275c4.61 4.84 8.32 11.25 10.19 18.16z"
386 fill="#FDB6FF"
387 />
388 <path
389 d="m242.01 163.51c0.131 0.484 0.169 0.729 0.419 1.697l111.86-30.218c-8.606-31.858-23.408-57.649-46.862-81.009l-81.486 81.231c7.34 7.56 13.13 17.41 16.07 28.3z"
390 fill="#FC92FF"
391 />
392 <path
393 d="m263.89 157.6c0.13 0.484 0.185 0.725 0.438 1.692l89.969-24.304c-8.606-31.858-23.408-57.649-46.862-81.009l-65.48 65.173c10.06 10.28 17.91 23.57 21.93 38.45z"
394 fill="#FB6EFF"
395 />
396 <path
397 d="m285.76 151.69c0.131 0.483 0.183 0.724 0.438 1.69l68.095-18.395c-8.606-31.858-23.408-57.649-46.862-81.009l-49.482 49.121c12.79 13 22.71 29.74 27.8 48.6z"
398 fill="#FA4AFF"
399 />
400 <path
401 d="m307.7 146.03c0.087 0.321 0.12 0.48 0.378 1.447l46.215-12.484c-8.606-31.858-23.408-57.649-46.862-81.009l-33.484 33.07c15.59 15.719 27.55 36.039 33.74 58.969z"
402 fill="#F927FF"
403 />
404 <path
405 d="m329.58 140.12c0.086 0.321 0.118 0.48 0.377 1.446l24.341-6.575c-8.606-31.858-23.52-58.061-46.974-81.421l-17.375 17.432c18.32 18.435 32.35 42.199 39.62 69.109z"
406 fill="#FF00FF"
407 />
408 </g
409 >
410</g
411 >
412<metadata
413 ><rdf:RDF
414 ><cc:Work
415 ><dc:format
416 >image/svg+xml</dc:format
417 ><dc:type
418 rdf:resource="http://purl.org/dc/dcmitype/StillImage"
419 /><cc:license
420 rdf:resource="http://creativecommons.org/licenses/publicdomain/"
421 /><dc:publisher
422 ><cc:Agent
423 rdf:about="http://openclipart.org/"
424 ><dc:title
425 >Openclipart</dc:title
426 ></cc:Agent
427 ></dc:publisher
428 ></cc:Work
429 ><cc:License
430 rdf:about="http://creativecommons.org/licenses/publicdomain/"
431 ><cc:permits
432 rdf:resource="http://creativecommons.org/ns#Reproduction"
433 /><cc:permits
434 rdf:resource="http://creativecommons.org/ns#Distribution"
435 /><cc:permits
436 rdf:resource="http://creativecommons.org/ns#DerivativeWorks"
437 /></cc:License
438 ></rdf:RDF
439 ></metadata
440 ></svg
441>
diff --git a/keyboards/clueboard/keymaps/default/keymap.c b/keyboards/clueboard/keymaps/default/keymap.c
index c4da561fe..dbfc04c57 100644
--- a/keyboards/clueboard/keymaps/default/keymap.c
+++ b/keyboards/clueboard/keymaps/default/keymap.c
@@ -5,8 +5,6 @@
5 5
6// Each layer gets a name for readability, which is then used in the keymap matrix below. 6// Each layer gets a name for readability, which is then used in the keymap matrix below.
7// The underscores don't mean anything - you can have a layer called STUFF or any other name. 7// The underscores don't mean anything - you can have a layer called STUFF or any other name.
8// Layer names don't all need to be of the same length, obviously, and you can also skip them
9// entirely and just use numbers.
10#define _BL 0 8#define _BL 0
11#define _FL 1 9#define _FL 1
12#define _CL 2 10#define _CL 2
@@ -33,7 +31,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
33 /* Keymap _CL: Control layer 31 /* Keymap _CL: Control layer
34 */ 32 */
35[_CL] = KEYMAP( 33[_CL] = KEYMAP(
36 BL_STEP,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,RGB_TOG, RGB_VAI, \ 34 BL_STEP,RGB_M_P,RGB_M_B,RGB_M_R,RGB_M_SW,RGB_M_SN,RGB_M_K,RGB_M_X,RGB_M_G,_______,_______,_______,_______,_______,RGB_TOG, RGB_VAI, \
37 _______,_______,_______,_______,RESET, _______,_______,_______,_______,_______,_______,_______,_______,_______, RGB_VAD, \ 35 _______,_______,_______,_______,RESET, _______,_______,_______,_______,_______,_______,_______,_______,_______, RGB_VAD, \
38 _______,_______,MO(_CL),_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, \ 36 _______,_______,MO(_CL),_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, \
39 MO(_FL),_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, RGB_SAI, \ 37 MO(_FL),_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, RGB_SAI, \
diff --git a/keyboards/clueboard/rev2/config.h b/keyboards/clueboard/rev2/config.h
index 8435fd02b..bc34fc07b 100644
--- a/keyboards/clueboard/rev2/config.h
+++ b/keyboards/clueboard/rev2/config.h
@@ -30,10 +30,17 @@
30/* Underlight configuration 30/* Underlight configuration
31 */ 31 */
32#define RGB_DI_PIN D7 32#define RGB_DI_PIN D7
33#define RGBLIGHT_ANIMATIONS
34#define RGBLED_NUM 14 // Number of LEDs 33#define RGBLED_NUM 14 // Number of LEDs
35#define RGBLIGHT_HUE_STEP 10 34#define RGBLIGHT_HUE_STEP 32
36#define RGBLIGHT_SAT_STEP 17 35#define RGBLIGHT_SAT_STEP 17
37#define RGBLIGHT_VAL_STEP 17 36#define RGBLIGHT_VAL_STEP 17
38 37
38#define RGBLIGHT_ANIMATIONS
39#define RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL 666*2
40#define RGBLIGHT_EFFECT_CHRISTMAS_STEP 1
41#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 3 // How many LEDs wide to light up
42#define RGBLIGHT_EFFECT_KNIGHT_OFFSET 1 // The led to start at
43#define RGBLIGHT_EFFECT_KNIGHT_LED_NUM 5 // How many LEDs to travel
44#define RGBLIGHT_EFFECT_SNAKE_LENGTH 4 // How many LEDs wide to light up
45
39#endif 46#endif
diff --git a/quantum/quantum.c b/quantum/quantum.c
index 87975ef99..285e1e81e 100644
--- a/quantum/quantum.c
+++ b/quantum/quantum.c
@@ -249,105 +249,153 @@ bool process_record_quantum(keyrecord_t *record) {
249 if (record->event.pressed) { 249 if (record->event.pressed) {
250 reset_keyboard(); 250 reset_keyboard();
251 } 251 }
252 return false; 252 return false;
253 break;
254 case DEBUG: 253 case DEBUG:
255 if (record->event.pressed) { 254 if (record->event.pressed) {
256 debug_enable = true; 255 debug_enable = true;
257 print("DEBUG: enabled.\n"); 256 print("DEBUG: enabled.\n");
258 } 257 }
259 return false; 258 return false;
260 break;
261 #ifdef FAUXCLICKY_ENABLE 259 #ifdef FAUXCLICKY_ENABLE
262 case FC_TOG: 260 case FC_TOG:
263 if (record->event.pressed) { 261 if (record->event.pressed) {
264 FAUXCLICKY_TOGGLE; 262 FAUXCLICKY_TOGGLE;
265 } 263 }
266 return false; 264 return false;
267 break;
268 case FC_ON: 265 case FC_ON:
269 if (record->event.pressed) { 266 if (record->event.pressed) {
270 FAUXCLICKY_ON; 267 FAUXCLICKY_ON;
271 } 268 }
272 return false; 269 return false;
273 break;
274 case FC_OFF: 270 case FC_OFF:
275 if (record->event.pressed) { 271 if (record->event.pressed) {
276 FAUXCLICKY_OFF; 272 FAUXCLICKY_OFF;
277 } 273 }
278 return false; 274 return false;
279 break;
280 #endif 275 #endif
281 #ifdef RGBLIGHT_ENABLE 276 #ifdef RGBLIGHT_ENABLE
282 case RGB_TOG: 277 case RGB_TOG:
283 if (record->event.pressed) { 278 if (record->event.pressed) {
284 rgblight_toggle(); 279 rgblight_toggle();
285 } 280 }
286 return false; 281 return false;
287 break; 282 case RGB_MOD:
288 case RGB_MOD: 283 if (record->event.pressed) {
289 if (record->event.pressed) { 284 rgblight_step();
290 rgblight_step(); 285 }
291 } 286 return false;
292 return false; 287 case RGB_HUI:
293 break; 288 if (record->event.pressed) {
294 case RGB_HUI: 289 rgblight_increase_hue();
295 if (record->event.pressed) { 290 }
296 rgblight_increase_hue(); 291 return false;
292 case RGB_HUD:
293 if (record->event.pressed) {
294 rgblight_decrease_hue();
295 }
296 return false;
297 case RGB_SAI:
298 if (record->event.pressed) {
299 rgblight_increase_sat();
300 }
301 return false;
302 case RGB_SAD:
303 if (record->event.pressed) {
304 rgblight_decrease_sat();
305 }
306 return false;
307 case RGB_VAI:
308 if (record->event.pressed) {
309 rgblight_increase_val();
310 }
311 return false;
312 case RGB_VAD:
313 if (record->event.pressed) {
314 rgblight_decrease_val();
315 }
316 return false;
317 case RGB_MODE_PLAIN:
318 if (record->event.pressed) {
319 rgblight_mode(1);
320 }
321 return false;
322 case RGB_MODE_BREATHE:
323 if (record->event.pressed) {
324 if ((2 <= rgblight_get_mode()) && (rgblight_get_mode() < 5)) {
325 rgblight_step();
326 } else {
327 rgblight_mode(2);
297 } 328 }
298 return false; 329 }
299 break; 330 return false;
300 case RGB_HUD: 331 case RGB_MODE_RAINBOW:
301 if (record->event.pressed) { 332 if (record->event.pressed) {
302 rgblight_decrease_hue(); 333 if ((6 <= rgblight_get_mode()) && (rgblight_get_mode() < 8)) {
334 rgblight_step();
335 } else {
336 rgblight_mode(6);
303 } 337 }
304 return false; 338 }
305 break; 339 return false;
306 case RGB_SAI: 340 case RGB_MODE_SWIRL:
307 if (record->event.pressed) { 341 if (record->event.pressed) {
308 rgblight_increase_sat(); 342 if ((9 <= rgblight_get_mode()) && (rgblight_get_mode() < 14)) {
343 rgblight_step();
344 } else {
345 rgblight_mode(9);
309 } 346 }
310 return false; 347 }
311 break; 348 return false;
312 case RGB_SAD: 349 case RGB_MODE_SNAKE:
313 if (record->event.pressed) { 350 if (record->event.pressed) {
314 rgblight_decrease_sat(); 351 if ((15 <= rgblight_get_mode()) && (rgblight_get_mode() < 20)) {
352 rgblight_step();
353 } else {
354 rgblight_mode(15);
315 } 355 }
316 return false; 356 }
317 break; 357 return false;
318 case RGB_VAI: 358 case RGB_MODE_KNIGHT:
319 if (record->event.pressed) { 359 if (record->event.pressed) {
320 rgblight_increase_val(); 360 if ((21 <= rgblight_get_mode()) && (rgblight_get_mode() < 23)) {
361 rgblight_step();
362 } else {
363 rgblight_mode(21);
321 } 364 }
322 return false; 365 }
323 break; 366 return false;
324 case RGB_VAD: 367 case RGB_MODE_XMAS:
325 if (record->event.pressed) { 368 if (record->event.pressed) {
326 rgblight_decrease_val(); 369 rgblight_mode(24);
370 }
371 return false;
372 case RGB_MODE_GRADIENT:
373 if (record->event.pressed) {
374 if ((25 <= rgblight_get_mode()) && (rgblight_get_mode() < 34)) {
375 rgblight_step();
376 } else {
377 rgblight_mode(25);
327 } 378 }
328 return false; 379 }
329 break; 380 return false;
330 #endif 381 #endif
331 #ifdef PROTOCOL_LUFA 382 #ifdef PROTOCOL_LUFA
332 case OUT_AUTO: 383 case OUT_AUTO:
333 if (record->event.pressed) { 384 if (record->event.pressed) {
334 set_output(OUTPUT_AUTO); 385 set_output(OUTPUT_AUTO);
335 } 386 }
336 return false; 387 return false;
337 break;
338 case OUT_USB: 388 case OUT_USB:
339 if (record->event.pressed) { 389 if (record->event.pressed) {
340 set_output(OUTPUT_USB); 390 set_output(OUTPUT_USB);
341 } 391 }
342 return false; 392 return false;
343 break;
344 #ifdef BLUETOOTH_ENABLE 393 #ifdef BLUETOOTH_ENABLE
345 case OUT_BT: 394 case OUT_BT:
346 if (record->event.pressed) { 395 if (record->event.pressed) {
347 set_output(OUTPUT_BLUETOOTH); 396 set_output(OUTPUT_BLUETOOTH);
348 } 397 }
349 return false; 398 return false;
350 break;
351 #endif 399 #endif
352 #endif 400 #endif
353 case MAGIC_SWAP_CONTROL_CAPSLOCK ... MAGIC_TOGGLE_NKRO: 401 case MAGIC_SWAP_CONTROL_CAPSLOCK ... MAGIC_TOGGLE_NKRO:
@@ -454,7 +502,6 @@ bool process_record_quantum(keyrecord_t *record) {
454 unregister_mods(MOD_BIT(KC_LSFT)); 502 unregister_mods(MOD_BIT(KC_LSFT));
455 } 503 }
456 return false; 504 return false;
457 // break;
458 } 505 }
459 506
460 case KC_RSPC: { 507 case KC_RSPC: {
@@ -477,7 +524,6 @@ bool process_record_quantum(keyrecord_t *record) {
477 unregister_mods(MOD_BIT(KC_RSFT)); 524 unregister_mods(MOD_BIT(KC_RSFT));
478 } 525 }
479 return false; 526 return false;
480 // break;
481 } 527 }
482 case GRAVE_ESC: { 528 case GRAVE_ESC: {
483 uint8_t shifted = get_mods() & ((MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT) 529 uint8_t shifted = get_mods() & ((MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)
diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h
index 1bb6706ba..ccd4565f5 100644
--- a/quantum/quantum_keycodes.h
+++ b/quantum/quantum_keycodes.h
@@ -401,6 +401,14 @@ enum quantum_keycodes {
401 RGB_SAD, 401 RGB_SAD,
402 RGB_VAI, 402 RGB_VAI,
403 RGB_VAD, 403 RGB_VAD,
404 RGB_MODE_PLAIN,
405 RGB_MODE_BREATHE,
406 RGB_MODE_RAINBOW,
407 RGB_MODE_SWIRL,
408 RGB_MODE_SNAKE,
409 RGB_MODE_KNIGHT,
410 RGB_MODE_XMAS,
411 RGB_MODE_GRADIENT,
404 412
405 // Left shift, open paren 413 // Left shift, open paren
406 KC_LSPO, 414 KC_LSPO,
@@ -534,6 +542,14 @@ enum quantum_keycodes {
534 542
535#define KC_GESC GRAVE_ESC 543#define KC_GESC GRAVE_ESC
536 544
545#define RGB_M_P RGB_MODE_PLAIN
546#define RGB_M_B RGB_MODE_BREATHE
547#define RGB_M_R RGB_MODE_RAINBOW
548#define RGB_M_SW RGB_MODE_SWIRL
549#define RGB_M_SN RGB_MODE_SNAKE
550#define RGB_M_K RGB_MODE_KNIGHT
551#define RGB_M_X RGB_MODE_XMAS
552#define RGB_M_G RGB_MODE_GRADIENT
537 553
538// L-ayer, T-ap - 256 keycode max, 16 layer max 554// L-ayer, T-ap - 256 keycode max, 16 layer max
539#define LT(layer, kc) (kc | QK_LAYER_TAP | ((layer & 0xF) << 8)) 555#define LT(layer, kc) (kc | QK_LAYER_TAP | ((layer & 0xF) << 8))
diff --git a/quantum/rgblight.c b/quantum/rgblight.c
index 1b5076450..5ae6e69d6 100644
--- a/quantum/rgblight.c
+++ b/quantum/rgblight.c
@@ -22,7 +22,6 @@
22#include "debug.h" 22#include "debug.h"
23#include "led_tables.h" 23#include "led_tables.h"
24 24
25
26__attribute__ ((weak)) 25__attribute__ ((weak))
27const uint8_t RGBLED_BREATHING_INTERVALS[] PROGMEM = {30, 20, 10, 5}; 26const uint8_t RGBLED_BREATHING_INTERVALS[] PROGMEM = {30, 20, 10, 5};
28__attribute__ ((weak)) 27__attribute__ ((weak))
@@ -32,7 +31,7 @@ const uint8_t RGBLED_RAINBOW_SWIRL_INTERVALS[] PROGMEM = {100, 50, 20};
32__attribute__ ((weak)) 31__attribute__ ((weak))
33const uint8_t RGBLED_SNAKE_INTERVALS[] PROGMEM = {100, 50, 20}; 32const uint8_t RGBLED_SNAKE_INTERVALS[] PROGMEM = {100, 50, 20};
34__attribute__ ((weak)) 33__attribute__ ((weak))
35const uint8_t RGBLED_KNIGHT_INTERVALS[] PROGMEM = {100, 50, 20}; 34const uint8_t RGBLED_KNIGHT_INTERVALS[] PROGMEM = {127, 63, 31};
36__attribute__ ((weak)) 35__attribute__ ((weak))
37const uint16_t RGBLED_GRADIENT_RANGES[] PROGMEM = {360, 240, 180, 120, 90}; 36const uint16_t RGBLED_GRADIENT_RANGES[] PROGMEM = {360, 240, 180, 120, 90};
38 37
@@ -197,6 +196,14 @@ void rgblight_step_reverse(void) {
197 rgblight_mode(mode); 196 rgblight_mode(mode);
198} 197}
199 198
199uint32_t rgblight_get_mode(void) {
200 if (!rgblight_config.enable) {
201 return false;
202 }
203
204 return rgblight_config.mode;
205}
206
200void rgblight_mode(uint8_t mode) { 207void rgblight_mode(uint8_t mode) {
201 if (!rgblight_config.enable) { 208 if (!rgblight_config.enable) {
202 return; 209 return;
@@ -220,6 +227,8 @@ void rgblight_mode(uint8_t mode) {
220 // MODE 9-14, rainbow swirl 227 // MODE 9-14, rainbow swirl
221 // MODE 15-20, snake 228 // MODE 15-20, snake
222 // MODE 21-23, knight 229 // MODE 21-23, knight
230 // MODE 24, xmas
231 // MODE 25-34, static rainbow
223 232
224 #ifdef RGBLIGHT_ANIMATIONS 233 #ifdef RGBLIGHT_ANIMATIONS
225 rgblight_timer_enable(); 234 rgblight_timer_enable();
@@ -550,7 +559,14 @@ void rgblight_effect_knight(uint8_t interval) {
550 static int8_t increment = 1; 559 static int8_t increment = 1;
551 uint8_t i, cur; 560 uint8_t i, cur;
552 561
562 // Set all the LEDs to 0
553 for (i = 0; i < RGBLED_NUM; i++) { 563 for (i = 0; i < RGBLED_NUM; i++) {
564 led[i].r = 0;
565 led[i].g = 0;
566 led[i].b = 0;
567 }
568 // Determine which LEDs should be lit up
569 for (i = 0; i < RGBLIGHT_EFFECT_KNIGHT_LED_NUM; i++) {
554 cur = (i + RGBLIGHT_EFFECT_KNIGHT_OFFSET) % RGBLED_NUM; 570 cur = (i + RGBLIGHT_EFFECT_KNIGHT_OFFSET) % RGBLED_NUM;
555 571
556 if (i >= low_bound && i <= high_bound) { 572 if (i >= low_bound && i <= high_bound) {
@@ -563,10 +579,12 @@ void rgblight_effect_knight(uint8_t interval) {
563 } 579 }
564 rgblight_set(); 580 rgblight_set();
565 581
582 // Move from low_bound to high_bound changing the direction we increment each
583 // time a boundary is hit.
566 low_bound += increment; 584 low_bound += increment;
567 high_bound += increment; 585 high_bound += increment;
568 586
569 if (high_bound <= 0 || low_bound >= RGBLED_NUM - 1) { 587 if (high_bound <= 0 || low_bound >= RGBLIGHT_EFFECT_KNIGHT_LED_NUM - 1) {
570 increment = -increment; 588 increment = -increment;
571 } 589 }
572} 590}
diff --git a/quantum/rgblight.h b/quantum/rgblight.h
index d0dd6e490..7acd5a257 100644
--- a/quantum/rgblight.h
+++ b/quantum/rgblight.h
@@ -23,16 +23,21 @@
23#endif 23#endif
24 24
25#ifndef RGBLIGHT_EFFECT_SNAKE_LENGTH 25#ifndef RGBLIGHT_EFFECT_SNAKE_LENGTH
26#define RGBLIGHT_EFFECT_SNAKE_LENGTH 7 26#define RGBLIGHT_EFFECT_SNAKE_LENGTH 4
27#endif 27#endif
28 28
29#ifndef RGBLIGHT_EFFECT_KNIGHT_LENGTH 29#ifndef RGBLIGHT_EFFECT_KNIGHT_LENGTH
30#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 7 30#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 3
31#endif 31#endif
32
32#ifndef RGBLIGHT_EFFECT_KNIGHT_OFFSET 33#ifndef RGBLIGHT_EFFECT_KNIGHT_OFFSET
33#define RGBLIGHT_EFFECT_KNIGHT_OFFSET 0 34#define RGBLIGHT_EFFECT_KNIGHT_OFFSET 0
34#endif 35#endif
35 36
37#ifndef RGBLIGHT_EFFECT_KNIGHT_LED_NUM
38#define RGBLIGHT_EFFECT_KNIGHT_LED_NUM RGBLED_NUM
39#endif
40
36#ifndef RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL 41#ifndef RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL
37#define RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL 1000 42#define RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL 1000
38#endif 43#endif
@@ -85,6 +90,7 @@ void rgblight_toggle(void);
85void rgblight_enable(void); 90void rgblight_enable(void);
86void rgblight_step(void); 91void rgblight_step(void);
87void rgblight_step_reverse(void); 92void rgblight_step_reverse(void);
93uint32_t rgblight_get_mode(void);
88void rgblight_mode(uint8_t mode); 94void rgblight_mode(uint8_t mode);
89void rgblight_set(void); 95void rgblight_set(void);
90void rgblight_update_dword(uint32_t dword); 96void rgblight_update_dword(uint32_t dword);