mirror of
https://github.com/qmk/qmk_firmware.git
synced 2026-09-25 03:18:42 +02:00
Merge remote-tracking branch 'upstream/develop' into xap
This commit is contained in:
+19
-18
@@ -374,11 +374,9 @@ def _extract_split_right_pins(info_data, config_c):
|
||||
# Figure out the right half matrix pins
|
||||
row_pins = config_c.get('MATRIX_ROW_PINS_RIGHT', '').replace('{', '').replace('}', '').strip()
|
||||
col_pins = config_c.get('MATRIX_COL_PINS_RIGHT', '').replace('{', '').replace('}', '').strip()
|
||||
unused_pin_text = config_c.get('UNUSED_PINS_RIGHT')
|
||||
unused_pins = unused_pin_text.replace('{', '').replace('}', '').strip() if isinstance(unused_pin_text, str) else None
|
||||
direct_pins = config_c.get('DIRECT_PINS_RIGHT', '').replace(' ', '')[1:-1]
|
||||
|
||||
if row_pins or col_pins or direct_pins or unused_pins:
|
||||
if row_pins or col_pins or direct_pins:
|
||||
if info_data.get('split', {}).get('matrix_pins', {}).get('right') in info_data:
|
||||
_log_warning(info_data, 'Right hand matrix data is specified in both info.json and config.h, the config.h values win.')
|
||||
|
||||
@@ -400,17 +398,12 @@ def _extract_split_right_pins(info_data, config_c):
|
||||
if direct_pins:
|
||||
info_data['split']['matrix_pins']['right']['direct'] = _extract_direct_matrix(direct_pins)
|
||||
|
||||
if unused_pins:
|
||||
info_data['split']['matrix_pins']['right']['unused'] = _extract_pins(unused_pins)
|
||||
|
||||
|
||||
def _extract_matrix_info(info_data, config_c):
|
||||
"""Populate the matrix information.
|
||||
"""
|
||||
row_pins = config_c.get('MATRIX_ROW_PINS', '').replace('{', '').replace('}', '').strip()
|
||||
col_pins = config_c.get('MATRIX_COL_PINS', '').replace('{', '').replace('}', '').strip()
|
||||
unused_pin_text = config_c.get('UNUSED_PINS')
|
||||
unused_pins = unused_pin_text.replace('{', '').replace('}', '').strip() if isinstance(unused_pin_text, str) else None
|
||||
direct_pins = config_c.get('DIRECT_PINS', '').replace(' ', '')[1:-1]
|
||||
info_snippet = {}
|
||||
|
||||
@@ -436,12 +429,6 @@ def _extract_matrix_info(info_data, config_c):
|
||||
|
||||
info_snippet['direct'] = _extract_direct_matrix(direct_pins)
|
||||
|
||||
if unused_pins:
|
||||
if 'matrix_pins' not in info_data:
|
||||
info_data['matrix_pins'] = {}
|
||||
|
||||
info_snippet['unused'] = _extract_pins(unused_pins)
|
||||
|
||||
if config_c.get('CUSTOM_MATRIX', 'no') != 'no':
|
||||
if 'matrix_pins' in info_data and 'custom' in info_data['matrix_pins']:
|
||||
_log_warning(info_data, 'Custom Matrix is specified in both info.json and config.h, the config.h values win.')
|
||||
@@ -523,10 +510,17 @@ def _extract_config_h(info_data, config_c):
|
||||
key_type = info_dict.get('value_type', 'raw')
|
||||
|
||||
try:
|
||||
replace_with = info_dict.get('replace_with')
|
||||
if config_key in config_c and info_dict.get('invalid', False):
|
||||
_log_error(info_data, '%s in config.h is no longer a valid option' % config_key)
|
||||
if replace_with:
|
||||
_log_error(info_data, '%s in config.h is no longer a valid option and should be replaced with %s' % (config_key, replace_with))
|
||||
else:
|
||||
_log_error(info_data, '%s in config.h is no longer a valid option and should be removed' % config_key)
|
||||
elif config_key in config_c and info_dict.get('deprecated', False):
|
||||
_log_warning(info_data, '%s in config.h is deprecated and will be removed at a later date' % config_key)
|
||||
if replace_with:
|
||||
_log_warning(info_data, '%s in config.h is deprecated in favor of %s and will be removed at a later date' % (config_key, replace_with))
|
||||
else:
|
||||
_log_warning(info_data, '%s in config.h is deprecated and will be removed at a later date' % config_key)
|
||||
|
||||
if config_key in config_c and info_dict.get('to_json', True):
|
||||
if dotty_info.get(info_key) and info_dict.get('warn_duplicate', True):
|
||||
@@ -589,10 +583,17 @@ def _extract_rules_mk(info_data, rules):
|
||||
key_type = info_dict.get('value_type', 'raw')
|
||||
|
||||
try:
|
||||
replace_with = info_dict.get('replace_with')
|
||||
if rules_key in rules and info_dict.get('invalid', False):
|
||||
_log_error(info_data, '%s in rules.mk is no longer a valid option' % rules_key)
|
||||
if replace_with:
|
||||
_log_error(info_data, '%s in rules.mk is no longer a valid option and should be replaced with %s' % (rules_key, replace_with))
|
||||
else:
|
||||
_log_error(info_data, '%s in rules.mk is no longer a valid option and should be removed' % rules_key)
|
||||
elif rules_key in rules and info_dict.get('deprecated', False):
|
||||
_log_warning(info_data, '%s in rules.mk is deprecated and will be removed at a later date' % rules_key)
|
||||
if replace_with:
|
||||
_log_warning(info_data, '%s in rules.mk is deprecated in favor of %s and will be removed at a later date' % (rules_key, replace_with))
|
||||
else:
|
||||
_log_warning(info_data, '%s in rules.mk is deprecated and will be removed at a later date' % rules_key)
|
||||
|
||||
if rules_key in rules and info_dict.get('to_json', True):
|
||||
if dotty_info.get(info_key) and info_dict.get('warn_duplicate', True):
|
||||
|
||||
Reference in New Issue
Block a user