diff options
Diffstat (limited to 'docs/feature_led_matrix.md')
-rw-r--r-- | docs/feature_led_matrix.md | 47 |
1 files changed, 24 insertions, 23 deletions
diff --git a/docs/feature_led_matrix.md b/docs/feature_led_matrix.md index ed92bffd9..d96199a3c 100644 --- a/docs/feature_led_matrix.md +++ b/docs/feature_led_matrix.md | |||
@@ -49,6 +49,8 @@ Here is an example using 2 drivers. | |||
49 | 49 | ||
50 | !> Note the parentheses, this is so when `LED_DRIVER_LED_TOTAL` is used in code and expanded, the values are added together before any additional math is applied to them. As an example, `rand() % (LED_DRIVER_1_LED_TOTAL + LED_DRIVER_2_LED_TOTAL)` will give very different results than `rand() % LED_DRIVER_1_LED_TOTAL + LED_DRIVER_2_LED_TOTAL`. | 50 | !> Note the parentheses, this is so when `LED_DRIVER_LED_TOTAL` is used in code and expanded, the values are added together before any additional math is applied to them. As an example, `rand() % (LED_DRIVER_1_LED_TOTAL + LED_DRIVER_2_LED_TOTAL)` will give very different results than `rand() % LED_DRIVER_1_LED_TOTAL + LED_DRIVER_2_LED_TOTAL`. |
51 | 51 | ||
52 | For split keyboards using `LED_MATRIX_SPLIT` with an LED driver, you can either have the same driver address or different driver addresses. If using different addresses, use `DRIVER_ADDR_1` for one and `DRIVER_ADDR_2` for the other one. Then, in `g_is31_leds`, fill out the correct driver index (0 or 1). If using one address, use `DRIVER_ADDR_1` for both, and use index 0 for `g_is31_leds`. | ||
53 | |||
52 | Define these arrays listing all the LEDs in your `<keyboard>.c`: | 54 | Define these arrays listing all the LEDs in your `<keyboard>.c`: |
53 | 55 | ||
54 | ```c | 56 | ```c |
@@ -164,26 +166,26 @@ You can disable a single effect by defining `DISABLE_[EFFECT_NAME]` in your `con | |||
164 | 166 | ||
165 | |Define |Description | | 167 | |Define |Description | |
166 | |-------------------------------------------------------|-----------------------------------------------| | 168 | |-------------------------------------------------------|-----------------------------------------------| |
167 | |`#define DISABLE_LED_MATRIX_ALPHAS_MODS` |Disables `LED_MATRIX_ALPHAS_MODS` | | 169 | |`#define ENABLE_LED_MATRIX_ALPHAS_MODS` |Enables `LED_MATRIX_ALPHAS_MODS` | |
168 | |`#define DISABLE_LED_MATRIX_BREATHING` |Disables `LED_MATRIX_BREATHING` | | 170 | |`#define ENABLE_LED_MATRIX_BREATHING` |Enables `LED_MATRIX_BREATHING` | |
169 | |`#define DISABLE_LED_MATRIX_BAND` |Disables `LED_MATRIX_BAND` | | 171 | |`#define ENABLE_LED_MATRIX_BAND` |Enables `LED_MATRIX_BAND` | |
170 | |`#define DISABLE_LED_MATRIX_BAND_PINWHEEL` |Disables `LED_MATRIX_BAND_PINWHEEL` | | 172 | |`#define ENABLE_LED_MATRIX_BAND_PINWHEEL` |Enables `LED_MATRIX_BAND_PINWHEEL` | |
171 | |`#define DISABLE_LED_MATRIX_BAND_SPIRAL` |Disables `LED_MATRIX_BAND_SPIRAL` | | 173 | |`#define ENABLE_LED_MATRIX_BAND_SPIRAL` |Enables `LED_MATRIX_BAND_SPIRAL` | |
172 | |`#define DISABLE_LED_MATRIX_CYCLE_LEFT_RIGHT` |Disables `LED_MATRIX_CYCLE_LEFT_RIGHT` | | 174 | |`#define ENABLE_LED_MATRIX_CYCLE_LEFT_RIGHT` |Enables `LED_MATRIX_CYCLE_LEFT_RIGHT` | |
173 | |`#define DISABLE_LED_MATRIX_CYCLE_UP_DOWN` |Disables `LED_MATRIX_CYCLE_UP_DOWN` | | 175 | |`#define ENABLE_LED_MATRIX_CYCLE_UP_DOWN` |Enables `LED_MATRIX_CYCLE_UP_DOWN` | |
174 | |`#define DISABLE_LED_MATRIX_CYCLE_OUT_IN` |Disables `LED_MATRIX_CYCLE_OUT_IN` | | 176 | |`#define ENABLE_LED_MATRIX_CYCLE_OUT_IN` |Enables `LED_MATRIX_CYCLE_OUT_IN` | |
175 | |`#define DISABLE_LED_MATRIX_DUAL_BEACON` |Disables `LED_MATRIX_DUAL_BEACON` | | 177 | |`#define ENABLE_LED_MATRIX_DUAL_BEACON` |Enables `LED_MATRIX_DUAL_BEACON` | |
176 | |`#define DISABLE_LED_MATRIX_SOLID_REACTIVE_SIMPLE` |Disables `LED_MATRIX_SOLID_REACTIVE_SIMPLE` | | 178 | |`#define ENABLE_LED_MATRIX_SOLID_REACTIVE_SIMPLE` |Enables `LED_MATRIX_SOLID_REACTIVE_SIMPLE` | |
177 | |`#define DISABLE_LED_MATRIX_SOLID_REACTIVE_WIDE` |Disables `LED_MATRIX_SOLID_REACTIVE_WIDE` | | 179 | |`#define ENABLE_LED_MATRIX_SOLID_REACTIVE_WIDE` |Enables `LED_MATRIX_SOLID_REACTIVE_WIDE` | |
178 | |`#define DISABLE_LED_MATRIX_SOLID_REACTIVE_MULTIWIDE` |Disables `LED_MATRIX_SOLID_REACTIVE_MULTIWIDE` | | 180 | |`#define ENABLE_LED_MATRIX_SOLID_REACTIVE_MULTIWIDE` |Enables `LED_MATRIX_SOLID_REACTIVE_MULTIWIDE` | |
179 | |`#define DISABLE_LED_MATRIX_SOLID_REACTIVE_CROSS` |Disables `LED_MATRIX_SOLID_REACTIVE_CROSS` | | 181 | |`#define ENABLE_LED_MATRIX_SOLID_REACTIVE_CROSS` |Enables `LED_MATRIX_SOLID_REACTIVE_CROSS` | |
180 | |`#define DISABLE_LED_MATRIX_SOLID_REACTIVE_MULTICROSS` |Disables `LED_MATRIX_SOLID_REACTIVE_MULTICROSS`| | 182 | |`#define ENABLE_LED_MATRIX_SOLID_REACTIVE_MULTICROSS` |Enables `LED_MATRIX_SOLID_REACTIVE_MULTICROSS`| |
181 | |`#define DISABLE_LED_MATRIX_SOLID_REACTIVE_NEXUS` |Disables `LED_MATRIX_SOLID_REACTIVE_NEXUS` | | 183 | |`#define ENABLE_LED_MATRIX_SOLID_REACTIVE_NEXUS` |Enables `LED_MATRIX_SOLID_REACTIVE_NEXUS` | |
182 | |`#define DISABLE_LED_MATRIX_SOLID_REACTIVE_MULTINEXUS` |Disables `LED_MATRIX_SOLID_REACTIVE_MULTINEXUS`| | 184 | |`#define ENABLE_LED_MATRIX_SOLID_REACTIVE_MULTINEXUS` |Enables `LED_MATRIX_SOLID_REACTIVE_MULTINEXUS`| |
183 | |`#define DISABLE_LED_MATRIX_SOLID_SPLASH` |Disables `LED_MATRIX_SOLID_SPLASH` | | 185 | |`#define ENABLE_LED_MATRIX_SOLID_SPLASH` |Enables `LED_MATRIX_SOLID_SPLASH` | |
184 | |`#define DISABLE_LED_MATRIX_SOLID_MULTISPLASH` |Disables `LED_MATRIX_SOLID_MULTISPLASH` | | 186 | |`#define ENABLE_LED_MATRIX_SOLID_MULTISPLASH` |Enables `LED_MATRIX_SOLID_MULTISPLASH` | |
185 | |`#define DISABLE_LED_MATRIX_WAVE_LEFT_RIGHT` |Disables `LED_MATRIX_WAVE_LEFT_RIGHT` | | 187 | |`#define ENABLE_LED_MATRIX_WAVE_LEFT_RIGHT` |Enables `LED_MATRIX_WAVE_LEFT_RIGHT` | |
186 | |`#define DISABLE_LED_MATRIX_WAVE_UP_DOWN` |Disables `LED_MATRIX_WAVE_UP_DOWN` | | 188 | |`#define ENABLE_LED_MATRIX_WAVE_UP_DOWN` |Enables `LED_MATRIX_WAVE_UP_DOWN` | |
187 | 189 | ||
188 | ## Custom LED Matrix Effects :id=custom-led-matrix-effects | 190 | ## Custom LED Matrix Effects :id=custom-led-matrix-effects |
189 | 191 | ||
@@ -219,7 +221,7 @@ static bool my_cool_effect(effect_params_t* params) { | |||
219 | for (uint8_t i = led_min; i < led_max; i++) { | 221 | for (uint8_t i = led_min; i < led_max; i++) { |
220 | led_matrix_set_value(i, 0xFF); | 222 | led_matrix_set_value(i, 0xFF); |
221 | } | 223 | } |
222 | return led_max < DRIVER_LED_TOTAL; | 224 | return led_matrix_check_finished_leds(led_max); |
223 | } | 225 | } |
224 | 226 | ||
225 | // e.g: A more complex effect, relying on external methods and state, with | 227 | // e.g: A more complex effect, relying on external methods and state, with |
@@ -233,8 +235,7 @@ static bool my_cool_effect2_complex_run(effect_params_t* params) { | |||
233 | for (uint8_t i = led_min; i < led_max; i++) { | 235 | for (uint8_t i = led_min; i < led_max; i++) { |
234 | led_matrix_set_value(i, some_global_state++); | 236 | led_matrix_set_value(i, some_global_state++); |
235 | } | 237 | } |
236 | 238 | return led_matrix_check_finished_leds(led_max); | |
237 | return led_max < DRIVER_LED_TOTAL; | ||
238 | } | 239 | } |
239 | static bool my_cool_effect2(effect_params_t* params) { | 240 | static bool my_cool_effect2(effect_params_t* params) { |
240 | if (params->init) my_cool_effect2_complex_init(params); | 241 | if (params->init) my_cool_effect2_complex_init(params); |