mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-09-10 17:15:43 +00:00
Add MATRIX_MASKED DD config (#25383)
This commit is contained in:
@@ -72,19 +72,6 @@ def generate_matrix_size(kb_info_json, config_h_lines):
|
||||
config_h_lines.append(generate_define('MATRIX_ROWS', kb_info_json['matrix_size']['rows']))
|
||||
|
||||
|
||||
def generate_matrix_masked(kb_info_json, config_h_lines):
|
||||
""""Enable matrix mask if required"""
|
||||
mask_required = False
|
||||
|
||||
if 'matrix_grid' in kb_info_json.get('dip_switch', {}):
|
||||
mask_required = True
|
||||
if 'matrix_grid' in kb_info_json.get('split', {}).get('handedness', {}):
|
||||
mask_required = True
|
||||
|
||||
if mask_required:
|
||||
config_h_lines.append(generate_define('MATRIX_MASKED'))
|
||||
|
||||
|
||||
def generate_config_items(kb_info_json, config_h_lines):
|
||||
"""Iterate through the info_config map to generate basic config values.
|
||||
"""
|
||||
@@ -202,8 +189,6 @@ def generate_config_h(cli):
|
||||
|
||||
generate_matrix_size(kb_info_json, config_h_lines)
|
||||
|
||||
generate_matrix_masked(kb_info_json, config_h_lines)
|
||||
|
||||
if 'matrix_pins' in kb_info_json:
|
||||
config_h_lines.append(matrix_pins(kb_info_json['matrix_pins']))
|
||||
|
||||
|
||||
@@ -254,6 +254,7 @@ def info_json(keyboard, force_layout=None):
|
||||
# Ensure that we have various calculated values
|
||||
info_data = _matrix_size(info_data)
|
||||
info_data = _joystick_axis_count(info_data)
|
||||
info_data = _matrix_masked(info_data)
|
||||
|
||||
# Merge in data from <keyboard.c>
|
||||
info_data = _extract_led_config(info_data, str(keyboard))
|
||||
@@ -830,6 +831,25 @@ def _joystick_axis_count(info_data):
|
||||
return info_data
|
||||
|
||||
|
||||
def _matrix_masked(info_data):
|
||||
""""Add info_data['matrix_pins.masked'] if required"""
|
||||
mask_required = False
|
||||
|
||||
if 'matrix_grid' in info_data.get('dip_switch', {}):
|
||||
mask_required = True
|
||||
if 'matrix_grid' in info_data.get('split', {}).get('handedness', {}):
|
||||
mask_required = True
|
||||
|
||||
if mask_required:
|
||||
if 'masked' not in info_data.get('matrix_pins', {}):
|
||||
if 'matrix_pins' not in info_data:
|
||||
info_data['matrix_pins'] = {}
|
||||
|
||||
info_data['matrix_pins']['masked'] = True
|
||||
|
||||
return info_data
|
||||
|
||||
|
||||
def _check_matrix(info_data):
|
||||
"""Check the matrix to ensure that row/column count is consistent.
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user