Implement kb function for rgb matrix to led lookup (#5738)

pull/4385/merge 0.6.346
XScorpion2 6 years ago committed by MechMerlin
parent 483ad4e3e0
commit bb208f3e3b

@ -1 +1,20 @@
#include "sol.h" #include "sol.h"
#if defined(RGB_MATRIX_ENABLE)
uint8_t rgb_matrix_map_row_column_to_led_kb(uint8_t row, uint8_t column, uint8_t *led_i) {
if (row == 4 && column == 5) {
led_i[0] = 33;
return 1;
} else if (row == 4 && column == 6) {
led_i[0] = 34;
return 1;
} else if (row == 10 && column == 5) {
led_i[0] = 68;
return 1;
} else if (row == 10 && column == 6) {
led_i[0] = 69;
return 1;
}
return 0;
}
#endif

@ -144,9 +144,14 @@ void eeconfig_debug_rgb_matrix(void) {
dprintf("rgb_matrix_config.speed = %d\n", rgb_matrix_config.speed); dprintf("rgb_matrix_config.speed = %d\n", rgb_matrix_config.speed);
} }
__attribute__ ((weak))
uint8_t rgb_matrix_map_row_column_to_led_kb(uint8_t row, uint8_t column, uint8_t *led_i) {
return 0;
}
uint8_t rgb_matrix_map_row_column_to_led(uint8_t row, uint8_t column, uint8_t *led_i) { uint8_t rgb_matrix_map_row_column_to_led(uint8_t row, uint8_t column, uint8_t *led_i) {
// TODO: This is kinda expensive, fix this soonish // TODO: This is kinda expensive, fix this soonish
uint8_t led_count = 0; uint8_t led_count = rgb_matrix_map_row_column_to_led_kb(row, column, led_i);
for (uint8_t i = 0; i < DRIVER_LED_TOTAL && led_count < LED_HITS_TO_REMEMBER; i++) { for (uint8_t i = 0; i < DRIVER_LED_TOTAL && led_count < LED_HITS_TO_REMEMBER; i++) {
matrix_co_t matrix_co = g_rgb_leds[i].matrix_co; matrix_co_t matrix_co = g_rgb_leds[i].matrix_co;
if (row == matrix_co.row && column == matrix_co.col) { if (row == matrix_co.row && column == matrix_co.col) {

Loading…
Cancel
Save