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

CLI: Parse USB device version BCD #14580

Merged
merged 4 commits into from Jan 16, 2022
Merged

Conversation

fauxpark
Copy link
Member

Description

DEVICE_VER is a BCD value in the format MMmr. This enhances the mapping between info.json and config.h from a simple 4 digit hex number to a version string.

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

@fauxpark
Copy link
Member Author

There are a handful of boards with DEVICE_VER digits > 9, these throw up a warning in qmk info:

⚠ 40percentclub/25: DEVICE_VER->usb.device_ver: invalid literal for int() with base 10: '0F'
40percentclub/25
40percentclub/5x5
40percentclub/6lit
40percentclub/foobar
40percentclub/half_n_half
boston_meetup/2019
coarse/ixora
coarse/vinta
handwired/qc60
lets_split_eh
ramonimbao/squishytkl
spacetime

@fauxpark
Copy link
Member Author

Last failing test is expected, due to the boards listed above which have invalid digits.

Copy link
Member

@tzarc tzarc left a comment

Choose a reason for hiding this comment

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

If we can fix up the conflicts, this can go in.

lib/python/qmk/info.py Outdated Show resolved Hide resolved
lib/python/qmk/info.py Outdated Show resolved Hide resolved
lib/python/qmk/info.py Outdated Show resolved Hide resolved
@drashna drashna requested a review from a team January 7, 2022 05:20
@tzarc tzarc merged commit c72ed7c into qmk:develop Jan 16, 2022
@fauxpark fauxpark deleted the info-bcd-version branch January 16, 2022 21:45
@fauxpark fauxpark mentioned this pull request Mar 28, 2022
14 tasks
@Sasasu

This comment was marked as off-topic.

@fauxpark
Copy link
Member Author

I'm not sure what you mean. You can see here, and in the actual USB spec, that this value is indeed BCD and should be treated as such: https://www.beyondlogic.org/usbnutshell/usb5.shtml#DeviceDescriptors

Therefore, digits greater than 9 are not allowed.

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.

None yet

5 participants