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

Remove use of broken split.main #22363

Merged
merged 2 commits into from
Oct 30, 2023
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
9 changes: 5 additions & 4 deletions data/schemas/keyboard.jsonschema
Original file line number Diff line number Diff line change
Expand Up @@ -681,10 +681,6 @@
}
}
},
"main": {
"type": "string",
"enum": ["eeprom", "left", "matrix_grid", "pin", "right"]
},
"soft_serial_pin": {"$ref": "qmk.definitions.v1#/mcu_pin"},
"soft_serial_speed": {
"type": "integer",
Expand Down Expand Up @@ -735,6 +731,11 @@
"polling_interval": {"$ref": "qmk.definitions.v1#/unsigned_int"},
"timeout": {"$ref": "qmk.definitions.v1#/unsigned_int"}
}
},
"main": {
"type": "string",
"enum": ["eeprom", "left", "matrix_grid", "pin", "right"],
"$comment": "Deprecated: use config.h options for now"
}
}
},
Expand Down
1 change: 0 additions & 1 deletion keyboards/controllerworks/mini42/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
},
"split": {
"enabled": true,
"main": "left",
"matrix_pins": {
"right": {
"direct": [
Expand Down
1 change: 0 additions & 1 deletion keyboards/hillside/48/0_1/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
},
"split": {
"soft_serial_pin": "D2",
"main": "left",
"encoder": {
"right": {
"rotary": [
Expand Down
1 change: 0 additions & 1 deletion keyboards/splitkb/aurora/corne/rev1/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@
"matrix": [4, 5]
},
"soft_serial_pin": "D2",
"main": "pin",
"matrix_pins": {
"right": {
"rows": ["B1", "B3", "B2", "B6"],
Expand Down
1 change: 0 additions & 1 deletion keyboards/splitkb/aurora/helix/rev1/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@
]
}
},
"main": "matrix_grid",
"matrix_pins": {
"right": {
"cols": ["D4", "C6", "D7", "E6", "B4", "B5", "B6"],
Expand Down
1 change: 0 additions & 1 deletion keyboards/splitkb/aurora/lily58/rev1/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@
"matrix": [5, 0]
},
"soft_serial_pin": "D2",
"main": "matrix_grid",
"matrix_pins": {
"right": {
"rows": ["F4", "D4", "B3", "B2", "B6"],
Expand Down
1 change: 0 additions & 1 deletion keyboards/splitkb/aurora/sofle_v2/rev1/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@
]
}
},
"main": "matrix_grid",
"matrix_pins": {
"right": {
"cols": ["D7", "E6", "B4", "B5", "D4", "C6"],
Expand Down
1 change: 0 additions & 1 deletion keyboards/splitkb/aurora/sweep/rev1/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@
"matrix": [4, 4]
},
"soft_serial_pin": "D2",
"main": "pin",
"matrix_pins": {
"right": {
"rows": ["B1", "F7", "F6", "B3"],
Expand Down
1 change: 0 additions & 1 deletion keyboards/splitkb/kyria/rev3/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@
"matrix": [4, 6]
},
"soft_serial_pin": "D2",
"main": "matrix_grid",
"matrix_pins": {
"right": {
"rows": ["F6", "F7", "B1", "B3"],
Expand Down
1 change: 0 additions & 1 deletion keyboards/tzarc/djinn/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
},
"split": {
"enabled": true,
"main": "pin",
"encoder": {
"right": {
"rotary": [
Expand Down
18 changes: 0 additions & 18 deletions lib/python/qmk/cli/generate/config_h.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,24 +141,6 @@ def generate_encoder_config(encoder_json, config_h_lines, postfix=''):

def generate_split_config(kb_info_json, config_h_lines):
"""Generate the config.h lines for split boards."""
if 'primary' in kb_info_json['split']:
if kb_info_json['split']['primary'] in ('left', 'right'):
config_h_lines.append('')
config_h_lines.append('#ifndef MASTER_LEFT')
config_h_lines.append('# ifndef MASTER_RIGHT')
if kb_info_json['split']['primary'] == 'left':
config_h_lines.append('# define MASTER_LEFT')
elif kb_info_json['split']['primary'] == 'right':
config_h_lines.append('# define MASTER_RIGHT')
config_h_lines.append('# endif // MASTER_RIGHT')
config_h_lines.append('#endif // MASTER_LEFT')
elif kb_info_json['split']['primary'] == 'pin':
config_h_lines.append(generate_define('SPLIT_HAND_PIN'))
elif kb_info_json['split']['primary'] == 'matrix_grid':
config_h_lines.append(generate_define('SPLIT_HAND_MATRIX_GRID', f'{{ {",".join(kb_info_json["split"]["matrix_grid"])} }}'))
elif kb_info_json['split']['primary'] == 'eeprom':
config_h_lines.append(generate_define('EE_HANDS'))

if 'protocol' in kb_info_json['split'].get('transport', {}):
if kb_info_json['split']['transport']['protocol'] == 'i2c':
config_h_lines.append(generate_define('USE_I2C'))
Expand Down
52 changes: 0 additions & 52 deletions lib/python/qmk/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,57 +352,6 @@ def _extract_secure_unlock(info_data, config_c):
info_data['secure']['unlock_sequence'] = unlock_array


def _extract_split_main(info_data, config_c):
"""Populate data about the split configuration
"""
# Figure out how the main half is determined
if config_c.get('SPLIT_HAND_PIN') is True:
if 'split' not in info_data:
info_data['split'] = {}

if 'main' in info_data['split']:
_log_warning(info_data, 'Split main hand is specified in both config.h (SPLIT_HAND_PIN) and info.json (split.main) (Value: %s), the config.h value wins.' % info_data['split']['main'])

info_data['split']['main'] = 'pin'

if config_c.get('SPLIT_HAND_MATRIX_GRID'):
if 'split' not in info_data:
info_data['split'] = {}

if 'main' in info_data['split']:
_log_warning(info_data, 'Split main hand is specified in both config.h (SPLIT_HAND_MATRIX_GRID) and info.json (split.main) (Value: %s), the config.h value wins.' % info_data['split']['main'])

info_data['split']['main'] = 'matrix_grid'
info_data['split']['matrix_grid'] = _extract_pins(config_c['SPLIT_HAND_MATRIX_GRID'])

if config_c.get('EE_HANDS') is True:
if 'split' not in info_data:
info_data['split'] = {}

if 'main' in info_data['split']:
_log_warning(info_data, 'Split main hand is specified in both config.h (EE_HANDS) and info.json (split.main) (Value: %s), the config.h value wins.' % info_data['split']['main'])

info_data['split']['main'] = 'eeprom'

if config_c.get('MASTER_RIGHT') is True:
if 'split' not in info_data:
info_data['split'] = {}

if 'main' in info_data['split']:
_log_warning(info_data, 'Split main hand is specified in both config.h (MASTER_RIGHT) and info.json (split.main) (Value: %s), the config.h value wins.' % info_data['split']['main'])

info_data['split']['main'] = 'right'

if config_c.get('MASTER_LEFT') is True:
if 'split' not in info_data:
info_data['split'] = {}

if 'main' in info_data['split']:
_log_warning(info_data, 'Split main hand is specified in both config.h (MASTER_LEFT) and info.json (split.main) (Value: %s), the config.h value wins.' % info_data['split']['main'])

info_data['split']['main'] = 'left'


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 @@ -594,7 +543,6 @@ def _extract_config_h(info_data, config_c):
_extract_matrix_info(info_data, config_c)
_extract_audio(info_data, config_c)
_extract_secure_unlock(info_data, config_c)
_extract_split_main(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