From 089a819179fe5a5eb25b8dc3fd595c9b6c485349 Mon Sep 17 00:00:00 2001 From: Ryan Date: Mon, 17 Jun 2024 06:57:37 +1000 Subject: [PATCH] keyboard.json schema: set minimum value for `key_unit` (#23937) * keyboard.json schema: set minimum value for `key_unit` * Fix invalid `matrix_size` in keyboard.json * Fix bad layout for silverbullet44 --- data/schemas/definitions.jsonschema | 3 +- data/schemas/keyboard.jsonschema | 8 ++--- keyboards/hazel/bad_wings/config.h | 3 ++ keyboards/hazel/bad_wings/keyboard.json | 4 --- keyboards/keychron/q1v2/config.h | 3 ++ keyboards/keychron/q1v2/info.json | 4 --- keyboards/mechlovin/olly/jf/rev1/config.h | 7 ++++ .../mechlovin/olly/jf/rev1/keyboard.json | 4 --- keyboards/silverbullet44/keyboard.json | 34 +++++++++---------- keyboards/snes_macropad/config.h | 3 ++ keyboards/snes_macropad/keyboard.json | 4 --- keyboards/zsa/voyager/config.h | 3 ++ keyboards/zsa/voyager/keyboard.json | 4 --- 13 files changed, 42 insertions(+), 42 deletions(-) create mode 100644 keyboards/mechlovin/olly/jf/rev1/config.h diff --git a/data/schemas/definitions.jsonschema b/data/schemas/definitions.jsonschema index a1fdd2dcc6..ef44915244 100644 --- a/data/schemas/definitions.jsonschema +++ b/data/schemas/definitions.jsonschema @@ -40,7 +40,8 @@ "pattern": "^[0-9a-z_/\\-]+\\.json$" }, "key_unit": { - "type": "number" + "type": "number", + "minimum": 0 }, "keyboard": { "type": "string", diff --git a/data/schemas/keyboard.jsonschema b/data/schemas/keyboard.jsonschema index b699f86277..e5802fe07d 100644 --- a/data/schemas/keyboard.jsonschema +++ b/data/schemas/keyboard.jsonschema @@ -515,8 +515,8 @@ "minimum": 0 } }, - "x": {"$ref": "qmk.definitions.v1#/key_unit"}, - "y": {"$ref": "qmk.definitions.v1#/key_unit"}, + "x": {"$ref": "qmk.definitions.v1#/unsigned_int"}, + "y": {"$ref": "qmk.definitions.v1#/unsigned_int"}, "flags": {"$ref": "qmk.definitions.v1#/unsigned_int_8"} } } @@ -601,8 +601,8 @@ "minimum": 0 } }, - "x": {"$ref": "qmk.definitions.v1#/key_unit"}, - "y": {"$ref": "qmk.definitions.v1#/key_unit"}, + "x": {"$ref": "qmk.definitions.v1#/unsigned_int"}, + "y": {"$ref": "qmk.definitions.v1#/unsigned_int"}, "flags": {"$ref": "qmk.definitions.v1#/unsigned_int_8"} } } diff --git a/keyboards/hazel/bad_wings/config.h b/keyboards/hazel/bad_wings/config.h index 4730172835..b69628e7fc 100644 --- a/keyboards/hazel/bad_wings/config.h +++ b/keyboards/hazel/bad_wings/config.h @@ -3,6 +3,9 @@ #pragma once +#define MATRIX_COLS 8 +#define MATRIX_ROWS 5 + #define SPI_SCK_PIN GP2 #define SPI_MOSI_PIN GP3 #define SPI_MISO_PIN GP4 diff --git a/keyboards/hazel/bad_wings/keyboard.json b/keyboards/hazel/bad_wings/keyboard.json index fef514c539..983b8c4fc3 100644 --- a/keyboards/hazel/bad_wings/keyboard.json +++ b/keyboards/hazel/bad_wings/keyboard.json @@ -10,10 +10,6 @@ }, "processor": "RP2040", "bootloader": "rp2040", - "matrix_size": { - "cols": 8, - "rows": 5 - }, "diode_direction": "COL2ROW", "features": { "bootmagic": true, diff --git a/keyboards/keychron/q1v2/config.h b/keyboards/keychron/q1v2/config.h index 326e60e3c0..2e93d80e4e 100644 --- a/keyboards/keychron/q1v2/config.h +++ b/keyboards/keychron/q1v2/config.h @@ -16,6 +16,9 @@ #pragma once +#define MATRIX_COLS 16 +#define MATRIX_ROWS 6 + /* RGB Matrix Driver Configuration */ #define SNLED27351_I2C_ADDRESS_1 SNLED27351_I2C_ADDRESS_VDDIO #define SNLED27351_I2C_ADDRESS_2 SNLED27351_I2C_ADDRESS_GND diff --git a/keyboards/keychron/q1v2/info.json b/keyboards/keychron/q1v2/info.json index ed718006e3..7eb7038696 100644 --- a/keyboards/keychron/q1v2/info.json +++ b/keyboards/keychron/q1v2/info.json @@ -32,10 +32,6 @@ "custom": true, "custom_lite": true }, - "matrix_size": { - "cols": 16, - "rows": 6 - }, "diode_direction": "ROW2COL", "rgb_matrix": { "driver": "snled27351", diff --git a/keyboards/mechlovin/olly/jf/rev1/config.h b/keyboards/mechlovin/olly/jf/rev1/config.h new file mode 100644 index 0000000000..9aa7e1c1d3 --- /dev/null +++ b/keyboards/mechlovin/olly/jf/rev1/config.h @@ -0,0 +1,7 @@ +// Copyright 2024 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#define MATRIX_COLS 19 +#define MATRIX_ROWS 6 diff --git a/keyboards/mechlovin/olly/jf/rev1/keyboard.json b/keyboards/mechlovin/olly/jf/rev1/keyboard.json index 69f092af07..1b8fa4a19a 100644 --- a/keyboards/mechlovin/olly/jf/rev1/keyboard.json +++ b/keyboards/mechlovin/olly/jf/rev1/keyboard.json @@ -16,10 +16,6 @@ "rows": ["D5", "D6", "A5", "A4", "A3", "A6"], "custom_lite": true }, - "matrix_size": { - "cols": 19, - "rows": 6 - }, "backlight": { "pin": "D4", "breathing": true diff --git a/keyboards/silverbullet44/keyboard.json b/keyboards/silverbullet44/keyboard.json index 793ec229e4..a58aed8820 100644 --- a/keyboards/silverbullet44/keyboard.json +++ b/keyboards/silverbullet44/keyboard.json @@ -92,29 +92,29 @@ {"matrix": [5, 1], "x": 16, "y": 1.75}, {"matrix": [5, 0], "x": 17, "y": 2.375}, - {"matrix": [2, 0], "x": 12, "y": 2.5}, - {"matrix": [2, 1], "x": 13, "y": 2.25}, - {"matrix": [2, 2], "x": 14, "y": 2}, - {"matrix": [2, 3], "x": 15, "y": 2.25}, - {"matrix": [2, 4], "x": 16, "y": 2.75}, - {"matrix": [2, 5], "x": 17, "y": 3.375}, + {"matrix": [2, 0], "x": 0, "y": 3.375}, + {"matrix": [2, 1], "x": 1, "y": 2.75}, + {"matrix": [2, 2], "x": 2, "y": 2.25}, + {"matrix": [2, 3], "x": 3, "y": 2}, + {"matrix": [2, 4], "x": 4, "y": 2.25}, + {"matrix": [2, 5], "x": 5, "y": 2.5}, - {"matrix": [6, 5], "x": 0, "y": 3.375}, - {"matrix": [6, 4], "x": 1, "y": 2.75}, - {"matrix": [6, 3], "x": 2, "y": 2.25}, - {"matrix": [6, 2], "x": 3, "y": 2}, - {"matrix": [6, 1], "x": 4, "y": 2.25}, - {"matrix": [6, 0], "x": 5, "y": 2.5}, + {"matrix": [6, 5], "x": 12, "y": 2.5}, + {"matrix": [6, 4], "x": 13, "y": 2.25}, + {"matrix": [6, 3], "x": 14, "y": 2}, + {"matrix": [6, 2], "x": 15, "y": 2.25}, + {"matrix": [6, 1], "x": 16, "y": 2.75}, + {"matrix": [6, 0], "x": 17, "y": 3.375}, {"matrix": [3, 2], "x": 4, "y": 3.25, "h": 1.25}, {"matrix": [3, 3], "x": 5, "y": 3.5}, - {"matrix": [3, 4], "x": -0.5, "y": 3.5, "h": 1.5}, - {"matrix": [3, 5], "x": 7, "y": 3.25, "h": 1.5}, + {"matrix": [3, 4], "x": 6, "y": 3.25, "h": 1.5}, + {"matrix": [3, 5], "x": 7, "y": 3.5, "h": 1.5}, - {"matrix": [7, 5], "x": -3, "y": 3.5, "h": 1.5}, - {"matrix": [7, 4], "x": -2, "y": 3.5, "h": 1.5}, + {"matrix": [7, 5], "x": 10, "y": 3.5, "h": 1.5}, + {"matrix": [7, 4], "x": 11, "y": 3.25, "h": 1.5}, {"matrix": [7, 3], "x": 12, "y": 3.5}, - {"matrix": [7, 2], "x": 13, "y": 3.25, "w": 1.25} + {"matrix": [7, 2], "x": 13, "y": 3.25, "h": 1.25} ] } } diff --git a/keyboards/snes_macropad/config.h b/keyboards/snes_macropad/config.h index c5edeb55f1..a8f0c7fc45 100644 --- a/keyboards/snes_macropad/config.h +++ b/keyboards/snes_macropad/config.h @@ -3,6 +3,9 @@ #pragma once +#define MATRIX_COLS 4 +#define MATRIX_ROWS 6 + #define RP2040_BOOTLOADER_DOUBLE_TAP_RESET #define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_LED GP25 #define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_TIMEOUT 500U diff --git a/keyboards/snes_macropad/keyboard.json b/keyboards/snes_macropad/keyboard.json index 3483fe8f53..91ee332357 100644 --- a/keyboards/snes_macropad/keyboard.json +++ b/keyboards/snes_macropad/keyboard.json @@ -19,10 +19,6 @@ "driver": "vendor" }, "processor": "RP2040", - "matrix_size": { - "cols": 4, - "rows": 6 - }, "url": "", "usb": { "device_version": "1.0.0", diff --git a/keyboards/zsa/voyager/config.h b/keyboards/zsa/voyager/config.h index 630c01fc80..27460c5910 100644 --- a/keyboards/zsa/voyager/config.h +++ b/keyboards/zsa/voyager/config.h @@ -4,6 +4,9 @@ #pragma once +#define MATRIX_COLS 7 +#define MATRIX_ROWS 12 + #define IS31FL3731_I2C_ADDRESS_1 IS31FL3731_I2C_ADDRESS_GND #define IS31FL3731_I2C_ADDRESS_2 IS31FL3731_I2C_ADDRESS_VCC diff --git a/keyboards/zsa/voyager/keyboard.json b/keyboards/zsa/voyager/keyboard.json index 3a7e7865ea..3c5f2931ef 100644 --- a/keyboards/zsa/voyager/keyboard.json +++ b/keyboards/zsa/voyager/keyboard.json @@ -27,10 +27,6 @@ "matrix": [0, 1] }, "diode_direction": "ROW2COL", - "matrix_size": { - "cols": 7, - "rows": 12 - }, "mousekey": { "delay": 0, "interval": 20,