Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix MATRIX_COLS and MATRIX_ROWS generation for custom matrix #19508

Merged
merged 1 commit into from
Jan 5, 2023

Conversation

sigprof
Copy link
Contributor

@sigprof sigprof commented Jan 5, 2023

Description

The code which generated the MATRIX_COLS and MATRIX_ROWS defines from the JSON information was checking the presence of the matrix_pins key, which may not exist if a custom matrix is used. Check the presence of matrix_size instead.

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout/userspace (addition or update)
  • Documentation

Checklist

  • My code follows the code style of this project: C, Python
  • I have read the PR Checklist document and have made the appropriate changes.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

@github-actions github-actions bot added cli qmk cli command python labels Jan 5, 2023
@zvecr zvecr added the bug label Jan 5, 2023
Copy link
Member

@zvecr zvecr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can go directly to master if you want?

The code which generated the MATRIX_COLS and MATRIX_ROWS defines from
the JSON information was checking the presence of the `matrix_pins` key,
which may not exist if a custom matrix is used.  Check the presence of
`matrix_size` instead.
@sigprof sigprof changed the base branch from develop to master January 5, 2023 20:09
@sigprof
Copy link
Contributor Author

sigprof commented Jan 5, 2023

Yes, the fix is rather trivial, so if you prefer pushing it to master directly, it's possible.

Although for my use case I already moved back to config.h, because that file is unavoidable anyway (I need some completely custom defines there), and in config.h I can put a comment which explain how that MATRIX_ROWS value was calculated without thinking about which not-really-JSON dialect we are using in info.json. The fix could still be useful for other boards though.

@zvecr zvecr merged commit 4a7d65b into qmk:master Jan 5, 2023
@sigprof sigprof deleted the custom-matrix-size-json branch January 6, 2023 12:09
omikronik pushed a commit to omikronik/qmk_firmware that referenced this pull request Jan 22, 2023
The code which generated the MATRIX_COLS and MATRIX_ROWS defines from
the JSON information was checking the presence of the `matrix_pins` key,
which may not exist if a custom matrix is used.  Check the presence of
`matrix_size` instead.
ideas32 pushed a commit to ideas32/qmk_firmware that referenced this pull request Jan 25, 2023
The code which generated the MATRIX_COLS and MATRIX_ROWS defines from
the JSON information was checking the presence of the `matrix_pins` key,
which may not exist if a custom matrix is used.  Check the presence of
`matrix_size` instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cli qmk cli command python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants