浏览代码

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
Chris Merrill 4 年之前
父节点
当前提交
16fe4b8b77

+ 5 - 5
keyboards/massdrop/alt/config_led.c

@@ -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,

+ 2 - 2
keyboards/massdrop/alt/keymaps/default/keymap.c

@@ -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);
                   }

+ 2 - 2
keyboards/massdrop/ctrl/config_led.c

@@ -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,

+ 2 - 2
keyboards/massdrop/ctrl/keymaps/default/keymap.c

@@ -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);
                   }

+ 5 - 3
tmk_core/protocol/arm_atsam/led_matrix.c

@@ -311,9 +311,11 @@ void led_matrix_indicators(void) {
                 (led_map[i].scan == USB_LED_KANA_SCANCODE && (kbled & (1 << USB_LED_KANA))) ||
 #endif  // KANA
                 (0)) {
-                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;
+                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;
+                }
             }
         }
     }