Browse Source

Add DD {LED,RGB}_MATRIX_DEFAULT_FLAGS support (#25671)

Joel Challis 10 months ago
parent
commit
0a4c1caf20

+ 2 - 0
data/mappings/info_config.hjson

@@ -112,6 +112,7 @@
     "LED_MATRIX_DEFAULT_ON": {"info_key": "led_matrix.default.on", "value_type": "bool"},
     "LED_MATRIX_DEFAULT_VAL": {"info_key": "led_matrix.default.val", "value_type": "int"},
     "LED_MATRIX_DEFAULT_SPD": {"info_key": "led_matrix.default.speed", "value_type": "int"},
+    "LED_MATRIX_DEFAULT_FLAGS": {"info_key": "led_matrix.default.flags", "value_type": "int"},
 
     // Locking Switch
     "LOCKING_SUPPORT_ENABLE": {"info_key": "qmk.locking.enabled", "value_type": "flag"},
@@ -166,6 +167,7 @@
     "RGB_MATRIX_DEFAULT_SAT": {"info_key": "rgb_matrix.default.sat", "value_type": "int"},
     "RGB_MATRIX_DEFAULT_VAL": {"info_key": "rgb_matrix.default.val", "value_type": "int"},
     "RGB_MATRIX_DEFAULT_SPD": {"info_key": "rgb_matrix.default.speed", "value_type": "int"},
+    "RGB_MATRIX_DEFAULT_FLAGS": {"info_key": "rgb_matrix.default.flags", "value_type": "int"},
 
     // RGBLight
     "RGBLED_SPLIT": {"info_key": "rgblight.split_count", "value_type": "array.int"},

+ 4 - 2
data/mappings/info_defaults.hjson

@@ -23,7 +23,8 @@
             "animation": "solid",
             "on": true,
             "val": 255,
-            "speed": 128
+            "speed": 128,
+            "flags": 255
         },
         "led_flush_limit": 16,
         "max_brightness": 255,
@@ -53,7 +54,8 @@
             "hue": 0,
             "sat": 255,
             "val": 255,
-            "speed": 128
+            "speed": 128,
+            "flags": 255
         },
         "hue_steps": 8,
         "led_flush_limit": 16,

+ 4 - 2
data/schemas/keyboard.jsonschema

@@ -543,7 +543,8 @@
                         "on": {"type": "boolean"},
                         "animation": {"type": "string"},
                         "val": {"$ref": "./definitions.jsonschema#/unsigned_int_8"},
-                        "speed": {"$ref": "./definitions.jsonschema#/unsigned_int_8"}
+                        "speed": {"$ref": "./definitions.jsonschema#/unsigned_int_8"},
+                        "flags": {"$ref": "./definitions.jsonschema#/unsigned_int_8"}
                     }
                 },
                 "driver": {
@@ -631,7 +632,8 @@
                         "hue": {"$ref": "./definitions.jsonschema#/unsigned_int_8"},
                         "sat": {"$ref": "./definitions.jsonschema#/unsigned_int_8"},
                         "val": {"$ref": "./definitions.jsonschema#/unsigned_int_8"},
-                        "speed": {"$ref": "./definitions.jsonschema#/unsigned_int_8"}
+                        "speed": {"$ref": "./definitions.jsonschema#/unsigned_int_8"},
+                        "flags": {"$ref": "./definitions.jsonschema#/unsigned_int_8"}
                     }
                 },
                 "driver": {

+ 6 - 0
docs/reference_info_json.md

@@ -431,6 +431,9 @@ Configures the [LED Matrix](features/led_matrix) feature.
         * `speed` <Badge type="info">Number</Badge>
             * The default animation speed.
             * Default: `128`
+        * `flags` <Badge type="info">Number</Badge>
+            * The default LED flags.
+            * Default: `255`
     * `driver` <Badge type="info">String</Badge> <Badge>Required</Badge>
         * The driver to use. Must be one of `custom`, `is31fl3218`, `is31fl3731`, `is31fl3733`, `is31fl3736`, `is31fl3737`, `is31fl3741`, `is31fl3742a`, `is31fl3743a`, `is31fl3745`, `is31fl3746a`, `snled27351`.
     * `layout` <Badge type="info">Array: Object</Badge> <Badge>Required</Badge>
@@ -685,6 +688,9 @@ Configures the [RGB Matrix](features/rgb_matrix) feature.
         * `speed` <Badge type="info">Number</Badge>
             * The default animation speed.
             * Default: `128`
+        * `flags` <Badge type="info">Number</Badge>
+            * The default LED flags.
+            * Default: `255`
     * `driver` <Badge type="info">String</Badge> <Badge>Required</Badge>
         * The driver to use. Must be one of `aw20216s`, `custom`, `is31fl3218`, `is31fl3236`, `is31fl3729`, `is31fl3731`, `is31fl3733`, `is31fl3736`, `is31fl3737`, `is31fl3741`, `is31fl3742a`, `is31fl3743a`, `is31fl3745`, `is31fl3746a`, `snled27351`, `ws2812`.
     * `hue_steps` <Badge type="info">Number</Badge>

+ 3 - 0
keyboards/xelus/valor/rev2/keyboard.json

@@ -67,6 +67,9 @@
             "solid_splash": true,
             "solid_multisplash": true
         },
+        "default": {
+            "flags": 7
+        },
         "driver": "ws2812",
         "max_brightness": 200,
         "sleep": true

+ 0 - 5
keyboards/xelus/valor/rev2/rev2.c

@@ -64,9 +64,4 @@ led_config_t g_led_config = { {
   8, 8, 8, 8
 } };
 
-
-void keyboard_pre_init_kb(void) {
-    rgb_matrix_set_flags(LED_FLAG_MODIFIER|LED_FLAG_UNDERGLOW|LED_FLAG_KEYLIGHT);
-    keyboard_pre_init_user();
-}
 #endif