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

Move keyboard USB IDs and strings to data driven: 0-9 #16481

Merged
merged 1 commit into from
Mar 13, 2022

Conversation

fauxpark
Copy link
Member

@fauxpark fauxpark commented Mar 1, 2022

Description

Some have been left out due to an issue with the ordering in which info.jsons at multiple levels are merged together, that will need to be resolved. For now, these can be done.

Types of Changes

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

Issues Fixed or Closed by This PR

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).

@zvecr zvecr merged commit c0f4179 into qmk:master Mar 13, 2022
@waffle87 waffle87 mentioned this pull request Mar 14, 2022
9 tasks
@fauxpark fauxpark deleted the keyboards-data-driven-usb-0-9 branch March 14, 2022 00:49
cadusk pushed a commit to cadusk/qmk_firmware that referenced this pull request Mar 14, 2022
* qmk/develop: (696 commits)
  Sentence correction (qmk#16650)
  [Keyboard] Add via keymap to AL1 (qmk#16499)
  Rename TICK to TICK_EVENT to prevent naming conflicts (qmk#16649)
  [Keyboard] Add BAMFK-1 (qmk#16409)
  Disable RGB matrix pixel animations for some boards (qmk#16643)
  keebio/iris: Add ifdefs to encoder callbacks (qmk#16642)
  bolsa/damapad - Fix missing layout macro (qmk#16639)
  Mousekeys fix (qmk#16640)
  Fix oneshot toggle logic (qmk#16630)
  Fix 40percentclub USB descriptors (qmk#16638)
  [Core] Move `has_mouse_report_changed` function to `report.c`  (qmk#16543)
  ISP flashing guide: add instructions for flashing STM32duino bootloader (qmk#16568)
  Move keyboard USB IDs and strings to data driven: 0-9 (qmk#16481)
  USB-USB converter cleanup (qmk#16618)
  [Keyboard] Add "Uno" rev2 (qmk#14071)
  [Keyboard] Add support for Jels60 (qmk#16605)
  helix:edvorakjp keymap change to use split_common (qmk#16532)
  [Keymap] Update personal crkbd keymap (qmk#16624)
  [Keyboard] add missing endif in glitch keyboard (qmk#16629)
  [Keyboard] Add damapad (qmk#16443)
  ...
tacahiroy pushed a commit to tacahiroy/qmk_firmware that referenced this pull request Mar 18, 2022
0xcharly pushed a commit to Bastardkb/bastardkb-qmk that referenced this pull request Jul 4, 2022
@myst729
Copy link
Contributor

myst729 commented Aug 19, 2022

Is this change involved with the build process? What will happen if info.json doesn't exist (e.g. fast prototyping)?

@myst729
Copy link
Contributor

myst729 commented Aug 19, 2022

Sometimes just hand craft the minimum of required files rather than run qmk cli: config.h, kb.h, kb.c, rules.mk, and a default keymap.c. Focusing the major idea, and most of other fields may be omitted and fall back to qmk default.

@fauxpark
Copy link
Member Author

info.json will eventually become the main config file for QMK keyboards. A lot of things from those files can already be defined there instead.

For the moment you can still specify the manufacturer and product strings in config.h, but after the next breaking changes merge (not this upcoming one), they will need to be actual string literals, eg:

#define MANUFACTURER "blah"

The reason for this is that without the quotes, the preprocessor can potentially mangle the strings because a word matches some other defined symbol. Here's an example from the Discord:

#define PRODUCT 3x4 F13 - F24 Function Keyboard

This gets preprocessed, baked into the firmware, and shown in Device Manager as:

3x4 ((ioline_t)((uint32_t)(GPIOF)) | ((uint32_t)(13))) - F24 Function Keyboard

Using string literals will also allow for better Unicode support.

These PRs were aimed at making this transition easier; after all of the strings have been moved to info.json, only the USB descriptor code and the CLI generation for the defines needs to be changed, and that makes for a much smaller and more easily reviewable diff.

@myst729
Copy link
Contributor

myst729 commented Aug 21, 2022

Got it. Thanks for the details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants