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

feat(boards): Support board revisions #2157

Merged
merged 9 commits into from
Mar 30, 2024

Conversation

zhiayang
Copy link
Contributor

@zhiayang zhiayang commented Feb 9, 2024

Split off from #1946; this is just the zmk infrastructure part to support board revisions.

Changes:

  1. Updated schema to support a list of revisions, as well as a default revision
  2. Updated setup.sh to prompt the user for revisions if the board yml defines revisions (and will also say which one is the default — if any)
  3. setup.sh will append @revision to the board name.

The script doesn't support revisions for shields yet, but if the approach is sound I'll add that as well as fix up the powershell script.

I've set up a repo to test: https://github.com/zhiayang/zmk-test, but this depends on #1946.

@zhiayang zhiayang requested a review from a team as a code owner February 9, 2024 17:12
@petejohanson
Copy link
Contributor

@zhiayang Thoughts on allowing fuzzy revisions in the YAML metadata so you can drop unneeded portions? Would allow you to add [email protected] as a revision target and not force specifying unneeded trailing version details.

Found this when working on #2195

Copy link
Contributor

@petejohanson petejohanson left a comment

Choose a reason for hiding this comment

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

It would be good to update the powershell script for this support as well. See my other comment about fuzzy version matching, and maybe allowing specifying a partial revision in the metadata.

@@ -133,6 +137,15 @@
"type": {
"type": "string",
"const": "interconnect"
},
"revisions": {
Copy link
Contributor

Choose a reason for hiding this comment

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

How do interconnect versions work? Not sure why this piece got added?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i think i was just autopiloting through this; don't think interconnects need revisions.

@@ -255,6 +277,15 @@
},
"exposes": {
"$ref": "#/$defs/interconnects"
},
"revisions": {
Copy link
Contributor

Choose a reason for hiding this comment

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

Shield variants are sadly not nearly as structured as board revisions. See https://docs.zephyrproject.org/3.5.0/hardware/porting/shields.html#shield-variants

This probably needs to be handled differently, or just not handled at all in this PR, so we can focus on getting board revisions in first.

@zhiayang
Copy link
Contributor Author

zhiayang commented Mar 9, 2024

thanks pete, i'll look at this over the weekend hopefully

@zhiayang
Copy link
Contributor Author

zhiayang commented Mar 11, 2024

re: partial revisions, the schema already supports it, and I've tested it works with the rest of the infrastructure -- the zephyr cmake stuff already handles partial revisions.

In #1946 I updated the mikoto.zmk.yml to include revision info (and I tried with the partial one, 7.1), and in the test repo (https://github.com/zhiayang/zmk-test/) i'm pulling from that PR branch.

It seems to work: https://github.com/zhiayang/zmk-test/actions/runs/8226802642/job/22493758007

(just ignore the mikoto_520 one, that one is broken for an unrelated reason)

edit: will edit the powershell script

@zhiayang
Copy link
Contributor Author

powershell script updated, is there anything else?

@zhiayang zhiayang requested a review from petejohanson March 16, 2024 01:09
Copy link
Contributor

@petejohanson petejohanson left a comment

Choose a reason for hiding this comment

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

Looks reasonable, thanks!

@petejohanson petejohanson merged commit 4bef4e9 into zmkfirmware:main Mar 30, 2024
8 checks passed
@zhiayang zhiayang deleted the board-revisions branch November 17, 2024 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants