Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move split.soft_serial_pin to split.serial.pin #24127

Merged
merged 1 commit into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion data/mappings/info_config.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand Down
8 changes: 6 additions & 2 deletions data/schemas/keyboard.jsonschema
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -836,7 +839,8 @@
"driver": {
"type": "string",
"enum": ["bitbang", "usart", "vendor"]
}
},
"pin": {"$ref": "qmk.definitions.v1#/mcu_pin"}
}
},
"transport": {
Expand Down
4 changes: 2 additions & 2 deletions docs/reference_info_json.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
10 changes: 5 additions & 5 deletions keyboards/zvecr/zv48/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
9 changes: 9 additions & 0 deletions lib/python/qmk/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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)
Expand Down
Loading