diff options
author | Zach White <skullydazed@gmail.com> | 2021-01-02 18:08:17 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-03 13:08:17 +1100 |
commit | 11bd98f684148ed9577b263189121e52027d66d9 (patch) | |
tree | a10d89e82aae10765082c3cc0a6893ac17ca89f7 /lib/python/qmk/cli/generate | |
parent | f27d8d94489342d4ce7ba9955cd062c725350db9 (diff) | |
download | qmk_firmware-11bd98f684148ed9577b263189121e52027d66d9.tar.gz qmk_firmware-11bd98f684148ed9577b263189121e52027d66d9.zip |
Fix broken keyboards (#11412)
* Fix a couple errors
* add a dependency for the generated headers
Diffstat (limited to 'lib/python/qmk/cli/generate')
-rwxr-xr-x | lib/python/qmk/cli/generate/layouts.py | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/python/qmk/cli/generate/layouts.py b/lib/python/qmk/cli/generate/layouts.py index 809f0ef7e..273870e15 100755 --- a/lib/python/qmk/cli/generate/layouts.py +++ b/lib/python/qmk/cli/generate/layouts.py | |||
@@ -39,15 +39,16 @@ def generate_layouts(cli): | |||
39 | # Build the layouts.h file. | 39 | # Build the layouts.h file. |
40 | layouts_h_lines = ['/* This file was generated by `qmk generate-layouts`. Do not edit or copy.' ' */', '', '#pragma once'] | 40 | layouts_h_lines = ['/* This file was generated by `qmk generate-layouts`. Do not edit or copy.' ' */', '', '#pragma once'] |
41 | 41 | ||
42 | if 'direct' in kb_info_json['matrix_pins']: | 42 | if 'matrix_pins' in kb_info_json: |
43 | col_num = len(kb_info_json['matrix_pins']['direct'][0]) | 43 | if 'direct' in kb_info_json['matrix_pins']: |
44 | row_num = len(kb_info_json['matrix_pins']['direct']) | 44 | col_num = len(kb_info_json['matrix_pins']['direct'][0]) |
45 | elif 'cols' in kb_info_json['matrix_pins'] and 'rows' in kb_info_json['matrix_pins']: | 45 | row_num = len(kb_info_json['matrix_pins']['direct']) |
46 | col_num = len(kb_info_json['matrix_pins']['cols']) | 46 | elif 'cols' in kb_info_json['matrix_pins'] and 'rows' in kb_info_json['matrix_pins']: |
47 | row_num = len(kb_info_json['matrix_pins']['rows']) | 47 | col_num = len(kb_info_json['matrix_pins']['cols']) |
48 | else: | 48 | row_num = len(kb_info_json['matrix_pins']['rows']) |
49 | cli.log.error('%s: Invalid matrix config.', cli.config.generate_layouts.keyboard) | 49 | else: |
50 | return False | 50 | cli.log.error('%s: Invalid matrix config.', cli.config.generate_layouts.keyboard) |
51 | return False | ||
51 | 52 | ||
52 | for layout_name in kb_info_json['layouts']: | 53 | for layout_name in kb_info_json['layouts']: |
53 | if kb_info_json['layouts'][layout_name]['c_macro']: | 54 | if kb_info_json['layouts'][layout_name]['c_macro']: |