diff options
| author | Ryan <fauxpark@gmail.com> | 2024-10-06 19:01:07 +1100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-06 21:01:07 +1300 |
| commit | 208ebf54a905ce6e4e563a6811eca8c8dc8b17e1 (patch) | |
| tree | 7bb6a8bdb5a641263c39236d0b655825ac37307b /quantum/led_matrix | |
| parent | 43e82ed5c72b7386ca91d1bd363ee092f77c1b9a (diff) | |
WS2812 API rework (#24364)
* Begin WS2812 API rework
* Move RGBW conversion, clean up color.h, fix RGBW for AVR bitbang
* Formatting & update PS2AVRGB I2C driver (untested)
* Tested ARM bitbang RGB+RGBW
* Tested ARM SPI RGB - RGBW not working
* Tested ARM PWM RGB+RGBW
* Tested RP2040 PIO driver RGB+RGBW
* Update RGBLight
* Formatting
* Fix BM60HSRGB rev2
* Fix oddforge/vea
* Fix 1k and XD002 RGBLite
* Fix model_m/mschwingen
* Fix handwired/promethium
* Rename `WS2812_LED_TOTAL` for BM60HSRGB
* Fix work_louder boards
* Fix dawn60
* Fix rgbkb/pan
* Fix neson_design/700e and n6
* Fix ergodox_ez/shine
* ergodox_ez/shine: invert indices for left half
* Fix matrix/abelx
* Fix matrix/m20add
* Remove custom rgblight driver for matrix/noah - should be done with lighting layers
* Fix LED indexes for RGBLight split
* Rename `convert_rgb_to_rgbw()` to `ws2812_rgb_to_rgbw()`
* Update WS2812 API docs
* `ergodox_ez/shine`: simplify LED index calculation
* LED/RGB Matrix: Add weak function for LED index resolution
* Bandaid fix for RGB Matrix splits not using WS2812
* `steelseries/prime_plus`: redo custom RGBLight driver
* Update keyboards/steelseries/prime_plus/rgblight_custom.c
Co-authored-by: Dasky <32983009+daskygit@users.noreply.github.com>
---------
Co-authored-by: Dasky <32983009+daskygit@users.noreply.github.com>
Diffstat (limited to 'quantum/led_matrix')
| -rw-r--r-- | quantum/led_matrix/led_matrix.c | 11 | ||||
| -rw-r--r-- | quantum/led_matrix/led_matrix.h | 2 |
2 files changed, 12 insertions, 1 deletions
diff --git a/quantum/led_matrix/led_matrix.c b/quantum/led_matrix/led_matrix.c index a5f0296f8d..58263c62e3 100644 --- a/quantum/led_matrix/led_matrix.c +++ b/quantum/led_matrix/led_matrix.c | |||
| @@ -139,11 +139,20 @@ void led_matrix_update_pwm_buffers(void) { | |||
| 139 | led_matrix_driver.flush(); | 139 | led_matrix_driver.flush(); |
| 140 | } | 140 | } |
| 141 | 141 | ||
| 142 | __attribute__((weak)) int led_matrix_led_index(int index) { | ||
| 143 | #if defined(LED_MATRIX_SPLIT) | ||
| 144 | if (!is_keyboard_left() && index >= k_led_matrix_split[0]) { | ||
| 145 | return index - k_led_matrix_split[0]; | ||
| 146 | } | ||
| 147 | #endif | ||
| 148 | return index; | ||
| 149 | } | ||
| 150 | |||
| 142 | void led_matrix_set_value(int index, uint8_t value) { | 151 | void led_matrix_set_value(int index, uint8_t value) { |
| 143 | #ifdef USE_CIE1931_CURVE | 152 | #ifdef USE_CIE1931_CURVE |
| 144 | value = pgm_read_byte(&CIE1931_CURVE[value]); | 153 | value = pgm_read_byte(&CIE1931_CURVE[value]); |
| 145 | #endif | 154 | #endif |
| 146 | led_matrix_driver.set_value(index, value); | 155 | led_matrix_driver.set_value(led_matrix_led_index(index), value); |
| 147 | } | 156 | } |
| 148 | 157 | ||
| 149 | void led_matrix_set_value_all(uint8_t value) { | 158 | void led_matrix_set_value_all(uint8_t value) { |
diff --git a/quantum/led_matrix/led_matrix.h b/quantum/led_matrix/led_matrix.h index 9a13c3e52b..a3468a2003 100644 --- a/quantum/led_matrix/led_matrix.h +++ b/quantum/led_matrix/led_matrix.h | |||
| @@ -121,6 +121,8 @@ void eeconfig_debug_led_matrix(void); | |||
| 121 | uint8_t led_matrix_map_row_column_to_led_kb(uint8_t row, uint8_t column, uint8_t *led_i); | 121 | uint8_t led_matrix_map_row_column_to_led_kb(uint8_t row, uint8_t column, uint8_t *led_i); |
| 122 | uint8_t led_matrix_map_row_column_to_led(uint8_t row, uint8_t column, uint8_t *led_i); | 122 | uint8_t led_matrix_map_row_column_to_led(uint8_t row, uint8_t column, uint8_t *led_i); |
| 123 | 123 | ||
| 124 | int led_matrix_led_index(int index); | ||
| 125 | |||
| 124 | void led_matrix_set_value(int index, uint8_t value); | 126 | void led_matrix_set_value(int index, uint8_t value); |
| 125 | void led_matrix_set_value_all(uint8_t value); | 127 | void led_matrix_set_value_all(uint8_t value); |
| 126 | 128 | ||
