From ebf5d460efc1dec471acf74883a0e7fa85e507be Mon Sep 17 00:00:00 2001 From: zvecr Date: Tue, 18 Jun 2024 01:33:32 +0100 Subject: [PATCH] Move split.soft_serial_pin to split.serial.pin --- data/mappings/info_config.hjson | 2 +- data/schemas/keyboard.jsonschema | 8 ++++++-- docs/reference_info_json.md | 4 ++-- keyboards/zvecr/zv48/info.json | 10 +++++----- lib/python/qmk/info.py | 9 +++++++++ 5 files changed, 23 insertions(+), 10 deletions(-) diff --git a/data/mappings/info_config.hjson b/data/mappings/info_config.hjson index 4f731b601134..4c895cf5d505 100644 --- a/data/mappings/info_config.hjson +++ b/data/mappings/info_config.hjson @@ -176,7 +176,7 @@ "SECURE_UNLOCK_TIMEOUT": {"info_key": "secure.unlock_timeout", "value_type": "int"}, // Split Keyboard - "SOFT_SERIAL_PIN": {"info_key": "split.soft_serial_pin"}, + "SOFT_SERIAL_PIN": {"info_key": "split.serial.pin"}, "SOFT_SERIAL_SPEED": {"info_key": "split.soft_serial_speed"}, "SPLIT_HAND_MATRIX_GRID": {"info_key": "split.handedness.matrix_grid", "value_type": "array", "to_c": false}, "SPLIT_HAND_PIN": {"info_key": "split.handedness.pin"}, diff --git a/data/schemas/keyboard.jsonschema b/data/schemas/keyboard.jsonschema index e758c325c77e..7649a8e31b26 100644 --- a/data/schemas/keyboard.jsonschema +++ b/data/schemas/keyboard.jsonschema @@ -823,7 +823,10 @@ } } }, - "soft_serial_pin": {"$ref": "qmk.definitions.v1#/mcu_pin"}, + "soft_serial_pin": { + "$ref": "qmk.definitions.v1#/mcu_pin", + "$comment": "Deprecated: use split.serial.pin instead" + }, "soft_serial_speed": { "type": "integer", "minimum": 0, @@ -836,7 +839,8 @@ "driver": { "type": "string", "enum": ["bitbang", "usart", "vendor"] - } + }, + "pin": {"$ref": "qmk.definitions.v1#/mcu_pin"} } }, "transport": { diff --git a/docs/reference_info_json.md b/docs/reference_info_json.md index a7a6caff7994..e658b48b715f 100644 --- a/docs/reference_info_json.md +++ b/docs/reference_info_json.md @@ -736,8 +736,8 @@ Configures the [Split Keyboard](features/split_keyboard) feature. * `driver` * The driver to use. Must be one of `bitbang`, `usart`, `vendor`. * Default: `"bitbang"` - * `soft_serial_pin` - * The GPIO pin to use (`serial` transport protocol only). + * `pin` + * The GPIO pin to use for transmit and receive. * `soft_serial_speed` * The protocol speed, from `0` to `5` (`serial` transport protocol only). * Default: `1` diff --git a/keyboards/zvecr/zv48/info.json b/keyboards/zvecr/zv48/info.json index 6e4daad312ea..39a05a61e60a 100644 --- a/keyboards/zvecr/zv48/info.json +++ b/keyboards/zvecr/zv48/info.json @@ -50,15 +50,15 @@ }, "split": { "enabled": true, - "handedness": { - "pin": "B9" - }, - "soft_serial_pin": "B6", "bootmagic": { "matrix": [4, 0] }, + "handedness": { + "pin": "B9" + }, "serial": { - "driver": "usart" + "driver": "usart", + "pin": "B6" }, "matrix_pins": { "right": { diff --git a/lib/python/qmk/info.py b/lib/python/qmk/info.py index 5b3b2490150f..5948b66b5e43 100644 --- a/lib/python/qmk/info.py +++ b/lib/python/qmk/info.py @@ -461,6 +461,14 @@ def _extract_split_handedness(info_data, config_c): split['handedness']['matrix_grid'] = split.pop('matrix_grid') +def _extract_split_serial(info_data, config_c): + # Migrate + split = info_data.get('split', {}) + if 'soft_serial_pin' in split: + split['serial'] = split.get('serial', {}) + split['serial']['pin'] = split.pop('soft_serial_pin') + + def _extract_split_transport(info_data, config_c): # Figure out the transport method if config_c.get('USE_I2C') is True: @@ -656,6 +664,7 @@ def _extract_config_h(info_data, config_c): _extract_audio(info_data, config_c) _extract_secure_unlock(info_data, config_c) _extract_split_handedness(info_data, config_c) + _extract_split_serial(info_data, config_c) _extract_split_transport(info_data, config_c) _extract_split_right_pins(info_data, config_c) _extract_encoders(info_data, config_c)