diff options
| author | QMK Bot <hello@qmk.fm> | 2023-03-24 02:47:22 +0000 |
|---|---|---|
| committer | QMK Bot <hello@qmk.fm> | 2023-03-24 02:47:22 +0000 |
| commit | 2ae5a4a5353e0397ca654ed9573f1b5fe507fe10 (patch) | |
| tree | c1fe4331b8cebbb54f9905e20853ad04385c6672 /lib/python/qmk | |
| parent | 18fedc080a12cf5231e15fd27d0be840f3985ba7 (diff) | |
| parent | d6ce42ae5b1093eeae215c073c733c800195ec28 (diff) | |
Merge remote-tracking branch 'origin/master' into develop
Diffstat (limited to 'lib/python/qmk')
| -rw-r--r-- | lib/python/qmk/c_parse.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/python/qmk/c_parse.py b/lib/python/qmk/c_parse.py index 663688e240..7dd464bd34 100644 --- a/lib/python/qmk/c_parse.py +++ b/lib/python/qmk/c_parse.py | |||
| @@ -90,8 +90,10 @@ def find_layouts(file): | |||
| 90 | cli.log.error('Invalid LAYOUT macro in %s: Empty parameter name in macro %s at pos %s.', file, macro_name, i) | 90 | cli.log.error('Invalid LAYOUT macro in %s: Empty parameter name in macro %s at pos %s.', file, macro_name, i) |
| 91 | elif key['label'] not in matrix_locations: | 91 | elif key['label'] not in matrix_locations: |
| 92 | cli.log.error('Invalid LAYOUT macro in %s: Key %s in macro %s has no matrix position!', file, key['label'], macro_name) | 92 | cli.log.error('Invalid LAYOUT macro in %s: Key %s in macro %s has no matrix position!', file, key['label'], macro_name) |
| 93 | elif len(matrix_locations.get(key['label'])) > 1: | ||
| 94 | cli.log.error('Invalid LAYOUT macro in %s: Key %s in macro %s has multiple matrix positions (%s)', file, key['label'], macro_name, ', '.join(str(x) for x in matrix_locations[key['label']])) | ||
| 93 | else: | 95 | else: |
| 94 | key['matrix'] = matrix_locations[key['label']] | 96 | key['matrix'] = matrix_locations[key['label']][0] |
| 95 | 97 | ||
| 96 | parsed_layouts[macro_name] = { | 98 | parsed_layouts[macro_name] = { |
| 97 | 'layout': parsed_layout, | 99 | 'layout': parsed_layout, |
| @@ -186,7 +188,9 @@ def _parse_matrix_locations(matrix, file, macro_name): | |||
| 186 | row = row.replace('{', '').replace('}', '') | 188 | row = row.replace('{', '').replace('}', '') |
| 187 | for col_num, identifier in enumerate(row.split(',')): | 189 | for col_num, identifier in enumerate(row.split(',')): |
| 188 | if identifier != 'KC_NO': | 190 | if identifier != 'KC_NO': |
| 189 | matrix_locations[identifier] = [row_num, col_num] | 191 | if identifier not in matrix_locations: |
| 192 | matrix_locations[identifier] = [] | ||
| 193 | matrix_locations[identifier].append([row_num, col_num]) | ||
| 190 | 194 | ||
| 191 | return matrix_locations | 195 | return matrix_locations |
| 192 | 196 | ||
