Upgraded HID interface
This commit is contained in:
@ -5,12 +5,12 @@ RGB_MATRIX_EFFECT(FFT_ANIM)
|
||||
#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS
|
||||
|
||||
// Maps fft columns to leds.
|
||||
// col_to_array[i] returns an array of leds in the ith bin of the fft.
|
||||
// fft_col_to_array[i] returns an array of leds in the ith bin of the fft.
|
||||
// Negative indices are "invisible" leds.
|
||||
// Use them when your keyboard has gaps.
|
||||
//
|
||||
// This layout is for the Ergodox EZ.
|
||||
static int8_t col_to_array[10][5] = {
|
||||
static int8_t fft_col_to_array[10][5] = {
|
||||
{ 47, 43, 38, 33, 28 },
|
||||
{ 46, 42, 37, 32, 27 },
|
||||
{ 45, 41, 36, 31, 26 },
|
||||
@ -62,13 +62,13 @@ bool FFT_ANIM(effect_params_t* params) {
|
||||
// There are 5 keys in each column.
|
||||
for (uint8_t i = bin_height; i < 6; i++) {
|
||||
// Ignore negative indices.
|
||||
// See col_to_array definition.
|
||||
if (col_to_array[bin][i] < 0) {
|
||||
// See fft_col_to_array definition.
|
||||
if (fft_col_to_array[bin][i] < 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
rgb_matrix_set_color(
|
||||
col_to_array[bin][i],
|
||||
fft_col_to_array[bin][i],
|
||||
0x00, 0x00, 0x00
|
||||
);
|
||||
}
|
||||
@ -77,8 +77,8 @@ bool FFT_ANIM(effect_params_t* params) {
|
||||
// Turn on leds that should be on.
|
||||
for (uint8_t i = 0; i < bin_height; i++) {
|
||||
// Ignore negative indices.
|
||||
// See col_to_array definition.
|
||||
if (col_to_array[bin][i] < 0) {
|
||||
// See fft_col_to_array definition.
|
||||
if (fft_col_to_array[bin][i] < 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -86,7 +86,7 @@ bool FFT_ANIM(effect_params_t* params) {
|
||||
// brightness depends on the height of the bar.
|
||||
if (i == bin_height - 1) {
|
||||
rgb_matrix_set_color(
|
||||
col_to_array[bin][i],
|
||||
fft_col_to_array[bin][i],
|
||||
last_brightness, 0x00, last_brightness
|
||||
);
|
||||
|
||||
@ -94,7 +94,7 @@ bool FFT_ANIM(effect_params_t* params) {
|
||||
// it has a plain full-brightness color.
|
||||
} else {
|
||||
rgb_matrix_set_color(
|
||||
col_to_array[bin][i],
|
||||
fft_col_to_array[bin][i],
|
||||
0x00, 0x00, 0xFF
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user