diff options
| author | XScorpion2 <rcalt2vt@gmail.com> | 2019-04-30 09:55:53 -0500 |
|---|---|---|
| committer | MechMerlin <30334081+mechmerlin@users.noreply.github.com> | 2019-04-30 07:55:53 -0700 |
| commit | bb208f3e3b69fb154f4f78d7538ffa28482f232f (patch) | |
| tree | e548229efcab7899d2702983d7d49ed11ffa182a | |
| parent | 483ad4e3e041084977bc128622aa49c637524b77 (diff) | |
| download | qmk_firmware-bb208f3e3b69fb154f4f78d7538ffa28482f232f.tar.gz qmk_firmware-bb208f3e3b69fb154f4f78d7538ffa28482f232f.zip | |
Implement kb function for rgb matrix to led lookup (#5738)
| -rw-r--r-- | keyboards/sol/sol.c | 19 | ||||
| -rw-r--r-- | quantum/rgb_matrix.c | 7 |
2 files changed, 25 insertions, 1 deletions
diff --git a/keyboards/sol/sol.c b/keyboards/sol/sol.c index 5945cc60a..a65d4c15f 100644 --- a/keyboards/sol/sol.c +++ b/keyboards/sol/sol.c | |||
| @@ -1 +1,20 @@ | |||
| 1 | #include "sol.h" | 1 | #include "sol.h" |
| 2 | |||
| 3 | #if defined(RGB_MATRIX_ENABLE) | ||
| 4 | uint8_t rgb_matrix_map_row_column_to_led_kb(uint8_t row, uint8_t column, uint8_t *led_i) { | ||
| 5 | if (row == 4 && column == 5) { | ||
| 6 | led_i[0] = 33; | ||
| 7 | return 1; | ||
| 8 | } else if (row == 4 && column == 6) { | ||
| 9 | led_i[0] = 34; | ||
| 10 | return 1; | ||
| 11 | } else if (row == 10 && column == 5) { | ||
| 12 | led_i[0] = 68; | ||
| 13 | return 1; | ||
| 14 | } else if (row == 10 && column == 6) { | ||
| 15 | led_i[0] = 69; | ||
| 16 | return 1; | ||
| 17 | } | ||
| 18 | return 0; | ||
| 19 | } | ||
| 20 | #endif | ||
diff --git a/quantum/rgb_matrix.c b/quantum/rgb_matrix.c index 8c16c7790..5528a0834 100644 --- a/quantum/rgb_matrix.c +++ b/quantum/rgb_matrix.c | |||
| @@ -144,9 +144,14 @@ void eeconfig_debug_rgb_matrix(void) { | |||
| 144 | dprintf("rgb_matrix_config.speed = %d\n", rgb_matrix_config.speed); | 144 | dprintf("rgb_matrix_config.speed = %d\n", rgb_matrix_config.speed); |
| 145 | } | 145 | } |
| 146 | 146 | ||
| 147 | __attribute__ ((weak)) | ||
| 148 | uint8_t rgb_matrix_map_row_column_to_led_kb(uint8_t row, uint8_t column, uint8_t *led_i) { | ||
| 149 | return 0; | ||
| 150 | } | ||
| 151 | |||
| 147 | uint8_t rgb_matrix_map_row_column_to_led(uint8_t row, uint8_t column, uint8_t *led_i) { | 152 | uint8_t rgb_matrix_map_row_column_to_led(uint8_t row, uint8_t column, uint8_t *led_i) { |
| 148 | // TODO: This is kinda expensive, fix this soonish | 153 | // TODO: This is kinda expensive, fix this soonish |
| 149 | uint8_t led_count = 0; | 154 | uint8_t led_count = rgb_matrix_map_row_column_to_led_kb(row, column, led_i); |
| 150 | for (uint8_t i = 0; i < DRIVER_LED_TOTAL && led_count < LED_HITS_TO_REMEMBER; i++) { | 155 | for (uint8_t i = 0; i < DRIVER_LED_TOTAL && led_count < LED_HITS_TO_REMEMBER; i++) { |
| 151 | matrix_co_t matrix_co = g_rgb_leds[i].matrix_co; | 156 | matrix_co_t matrix_co = g_rgb_leds[i].matrix_co; |
| 152 | if (row == matrix_co.row && column == matrix_co.col) { | 157 | if (row == matrix_co.row && column == matrix_co.col) { |
