diff options
Diffstat (limited to 'lib')
| -rwxr-xr-x | lib/python/qmk/cli/generate/config_h.py | 15 | ||||
| -rw-r--r-- | lib/python/qmk/info.py | 20 |
2 files changed, 20 insertions, 15 deletions
diff --git a/lib/python/qmk/cli/generate/config_h.py b/lib/python/qmk/cli/generate/config_h.py index d613f7b92c..d6d0299291 100755 --- a/lib/python/qmk/cli/generate/config_h.py +++ b/lib/python/qmk/cli/generate/config_h.py | |||
| @@ -72,19 +72,6 @@ def generate_matrix_size(kb_info_json, config_h_lines): | |||
| 72 | config_h_lines.append(generate_define('MATRIX_ROWS', kb_info_json['matrix_size']['rows'])) | 72 | config_h_lines.append(generate_define('MATRIX_ROWS', kb_info_json['matrix_size']['rows'])) |
| 73 | 73 | ||
| 74 | 74 | ||
| 75 | def generate_matrix_masked(kb_info_json, config_h_lines): | ||
| 76 | """"Enable matrix mask if required""" | ||
| 77 | mask_required = False | ||
| 78 | |||
| 79 | if 'matrix_grid' in kb_info_json.get('dip_switch', {}): | ||
| 80 | mask_required = True | ||
| 81 | if 'matrix_grid' in kb_info_json.get('split', {}).get('handedness', {}): | ||
| 82 | mask_required = True | ||
| 83 | |||
| 84 | if mask_required: | ||
| 85 | config_h_lines.append(generate_define('MATRIX_MASKED')) | ||
| 86 | |||
| 87 | |||
| 88 | def generate_config_items(kb_info_json, config_h_lines): | 75 | def generate_config_items(kb_info_json, config_h_lines): |
| 89 | """Iterate through the info_config map to generate basic config values. | 76 | """Iterate through the info_config map to generate basic config values. |
| 90 | """ | 77 | """ |
| @@ -202,8 +189,6 @@ def generate_config_h(cli): | |||
| 202 | 189 | ||
| 203 | generate_matrix_size(kb_info_json, config_h_lines) | 190 | generate_matrix_size(kb_info_json, config_h_lines) |
| 204 | 191 | ||
| 205 | generate_matrix_masked(kb_info_json, config_h_lines) | ||
| 206 | |||
| 207 | if 'matrix_pins' in kb_info_json: | 192 | if 'matrix_pins' in kb_info_json: |
| 208 | config_h_lines.append(matrix_pins(kb_info_json['matrix_pins'])) | 193 | config_h_lines.append(matrix_pins(kb_info_json['matrix_pins'])) |
| 209 | 194 | ||
diff --git a/lib/python/qmk/info.py b/lib/python/qmk/info.py index db8a02d132..b4fa481b1b 100644 --- a/lib/python/qmk/info.py +++ b/lib/python/qmk/info.py | |||
| @@ -254,6 +254,7 @@ def info_json(keyboard, force_layout=None): | |||
| 254 | # Ensure that we have various calculated values | 254 | # Ensure that we have various calculated values |
| 255 | info_data = _matrix_size(info_data) | 255 | info_data = _matrix_size(info_data) |
| 256 | info_data = _joystick_axis_count(info_data) | 256 | info_data = _joystick_axis_count(info_data) |
| 257 | info_data = _matrix_masked(info_data) | ||
| 257 | 258 | ||
| 258 | # Merge in data from <keyboard.c> | 259 | # Merge in data from <keyboard.c> |
| 259 | info_data = _extract_led_config(info_data, str(keyboard)) | 260 | info_data = _extract_led_config(info_data, str(keyboard)) |
| @@ -830,6 +831,25 @@ def _joystick_axis_count(info_data): | |||
| 830 | return info_data | 831 | return info_data |
| 831 | 832 | ||
| 832 | 833 | ||
| 834 | def _matrix_masked(info_data): | ||
| 835 | """"Add info_data['matrix_pins.masked'] if required""" | ||
| 836 | mask_required = False | ||
| 837 | |||
| 838 | if 'matrix_grid' in info_data.get('dip_switch', {}): | ||
| 839 | mask_required = True | ||
| 840 | if 'matrix_grid' in info_data.get('split', {}).get('handedness', {}): | ||
| 841 | mask_required = True | ||
| 842 | |||
| 843 | if mask_required: | ||
| 844 | if 'masked' not in info_data.get('matrix_pins', {}): | ||
| 845 | if 'matrix_pins' not in info_data: | ||
| 846 | info_data['matrix_pins'] = {} | ||
| 847 | |||
| 848 | info_data['matrix_pins']['masked'] = True | ||
| 849 | |||
| 850 | return info_data | ||
| 851 | |||
| 852 | |||
| 833 | def _check_matrix(info_data): | 853 | def _check_matrix(info_data): |
| 834 | """Check the matrix to ensure that row/column count is consistent. | 854 | """Check the matrix to ensure that row/column count is consistent. |
| 835 | """ | 855 | """ |
