Update massdrop/alt and arm_atsam/led_matrix to fix #10813 (#10818)

* Update massdrop/alt keyboard to fix Caps Lock LED flickering.

* Fix Caps-lock LED during underglow-only for massdrop/ctrl

* Update keyboards/massdrop/ctrl/keymaps/default/keymap.c
This commit is contained in:
Chris Merrill 2020-11-09 16:33:40 -05:00 committed by GitHub
parent 84ca67f158
commit 16fe4b8b77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 16 additions and 14 deletions

View File

@ -37,11 +37,11 @@ led_config_t g_led_config = { {
{ 224, 13 }, { 224, 25 }, { 224, 38 }, { 224, 50 }, { 222, 62 }, { 191, 64 }, { 179, 64 }, { 167, 64 }, { 153, 64 }, { 139, 64 }, { 125, 64 }, { 112, 64 }, { 98, 64 }, { 84, 64 }, { 70, 64 },
{ 56, 64 }, { 42, 64 }, { 28, 64 }, { 1, 62 }, { 0, 50 }, { 0, 38 }, { 0, 25 }, { 0, 13 }
}, {
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4,
1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1,
1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1,
9, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1,
1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1,
1, 1, 1, 4, 1, 1, 1, 1, 1,
// Underglow LEDs
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,

View File

@ -87,11 +87,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
switch (rgb_matrix_get_flags()) {
case LED_FLAG_ALL: {
rgb_matrix_set_flags(LED_FLAG_KEYLIGHT);
rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR);
rgb_matrix_set_color_all(0, 0, 0);
}
break;
case LED_FLAG_KEYLIGHT: {
case (LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR): {
rgb_matrix_set_flags(LED_FLAG_UNDERGLOW);
rgb_matrix_set_color_all(0, 0, 0);
}

View File

@ -46,7 +46,7 @@ led_config_t g_led_config = { {
}, {
// KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS
1, 4, 4, 4, 4, 1, 1, 1,
1, 4, 4, 4, 4, 1, 1, 1,
1, 4, 4, 4, 4, 1, 9, 1,
// KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP
4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 1, 1, 1,
@ -56,7 +56,7 @@ led_config_t g_led_config = { {
4, 4, 4, 4, 4, 4, 1, 1,
1,
// KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT
1, 4, 4, 4, 4, 4, 4, 4,
9, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 1,
// KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP
1, 4, 4, 4, 4, 4, 4, 4,

View File

@ -100,11 +100,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
switch (rgb_matrix_get_flags()) {
case LED_FLAG_ALL: {
rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER);
rgb_matrix_set_flags(LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR);
rgb_matrix_set_color_all(0, 0, 0);
}
break;
case LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER: {
case (LED_FLAG_KEYLIGHT | LED_FLAG_MODIFIER | LED_FLAG_INDICATOR): {
rgb_matrix_set_flags(LED_FLAG_UNDERGLOW);
rgb_matrix_set_color_all(0, 0, 0);
}

View File

@ -311,6 +311,7 @@ void led_matrix_indicators(void) {
(led_map[i].scan == USB_LED_KANA_SCANCODE && (kbled & (1 << USB_LED_KANA))) ||
#endif // KANA
(0)) {
if (rgb_matrix_get_flags() & LED_FLAG_INDICATOR) {
led_buffer[i].r = 255 - led_buffer[i].r;
led_buffer[i].g = 255 - led_buffer[i].g;
led_buffer[i].b = 255 - led_buffer[i].b;
@ -318,6 +319,7 @@ void led_matrix_indicators(void) {
}
}
}
}
const rgb_matrix_driver_t rgb_matrix_driver = {.init = init, .flush = flush, .set_color = led_set_one, .set_color_all = led_set_all};