Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change led to led_matrix in rgb_matrix_drivers #9412

Merged
merged 3 commits into from
Jun 20, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions quantum/rgb_matrix_drivers.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,27 +98,27 @@ const rgb_matrix_driver_t rgb_matrix_driver = {
#elif defined(WS2812)

// LED color buffer
LED_TYPE led[DRIVER_LED_TOTAL];
LED_TYPE led_matrix[DRIVER_LED_TOTAL];

static void init(void) {}

static void flush(void) {
// Assumes use of RGB_DI_PIN
ws2812_setleds(led, DRIVER_LED_TOTAL);
ws2812_setleds(led_matrix, DRIVER_LED_TOTAL);
}

// Set an led in the buffer to a color
static inline void setled(int i, uint8_t r, uint8_t g, uint8_t b) {
led[i].r = r;
led[i].g = g;
led[i].b = b;
led_matrix[i].r = r;
led_matrix[i].g = g;
led_matrix[i].b = b;
# ifdef RGBW
convert_rgb_to_rgbw(led[i]);
convert_rgb_to_rgbw(led_matrix[i]);
# endif
}

static void setled_all(uint8_t r, uint8_t g, uint8_t b) {
for (int i = 0; i < sizeof(led) / sizeof(led[0]); i++) {
for (int i = 0; i < sizeof(led_matrix) / sizeof(led_matrix[0]); i++) {
setled(i, r, g, b);
}
}
Expand Down