-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Add hardware metadata files, generate setup scripts and hardware docs from them. #883
Add hardware metadata files, generate setup scripts and hardware docs from them. #883
Conversation
3bf4a2c
to
e144133
Compare
Generally, I think this metadata format is a good start. I like the Maybe we can consider rolling all the power profiler stuff into here too. Although that may require a bit of a refactor on how we currently do it, including getting readings of different SoCs. Do we have a plan on how to update/extend this metadata? I can list 100 more things I could see us having on this, but I don't think we need them right now. |
Besides getting rid of the hardcoded setup scripts and hardware docs page, we also need to update the GitHub workflows to not require hardcoding every board and shield as well. Or maybe we can try doing an overhaul with only the minimum being built with PRs (#502). |
Hmm... Good question. Let me think on that.
I could see getting some power related stuff in here, yeah, e.g. quiescent at idle, perhaps add a
A few thoughts:
|
f86bb2f
to
e49a8fd
Compare
"$defs": { | ||
"id": { | ||
"type": "string", | ||
"pattern": "^[a-z0-9_]+$" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it okay for an ID to start with a number? (Not sure if these IDs need to match C identifier rules.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These do not need to be C identifiers, and we should be a bit more flexible here, for when someone has a keyboard named funky things like _33ble (Looking at you, @tominabox1 )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That works. Just wanted to make sure we didn't need this to be [a-z_][a-z0-9_]*
d6aba4a
to
bdd2033
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some small proofreading suggestions. Also, can we use package-lock.json version 2 for this PR?
Agreed. It would be nice to stop completely rewriting the lock file every few changes. (Upgrade to Node 14.x which includes NPM 7.x, or just upgrade NPM on its own.) |
25aff76
to
c6b6580
Compare
This was done from our dev container. I have a feeling, dependabot keeps upgrading it, causing the flip floppiness. |
c6b6580
to
c632551
Compare
Fixed this up to avoid the lock file version flip flopping. |
c632551
to
30f8a38
Compare
5fb0c1c
to
8e00e6a
Compare
160f92a
to
8425c52
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
|
||
The array should contrain the complete harware IDs of the siblings that combine in the logical device, e.g.: | ||
|
||
```yaml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Siblings" might be a confusing term to use here. It seems to me like "corne" is more of a top-level item, and "corne_left" and "corne_right" are its children. Siblings makes me think that you'd have something more like
id: corne_left
siblings: [corne_right]
id: corne_right
siblings: [corne_left]
(You also need to scroll up to the top of this page to see that this array belongs in the "corne" file and not in both left and right files.)
</p> | ||
<ul> | ||
{grouped["onboard"] | ||
.sort((a, b) => a.name.localeCompare(b.name)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we ever start getting into things with double digit version numbers, we might want to pull in something like https://www.npmjs.com/package/string-natural-compare to sort numbers embedded in strings numerically instead of lexicographically.
* Initial hardware metadata JSON schema. * GH Action to validate all schemas for boards/shields.
8425c52
to
01ab542
Compare
* Generate TS types from new hardware metadata schema. * Aggregate all hw metadata YAML into one aggregate JSON file for consumption by others.
7e0034c
to
390e25b
Compare
390e25b
to
8bc3ab9
Compare
* Standalone and pro-micro format board metadata added.
* No longer recommending that all new shields get added to the build matrix in `build.yml`, so we avoid conflicts.
* Add interconnect details. * Add m60 and nrf52840_m2 metadata files.
8bc3ab9
to
5023ae8
Compare
Draft PR for the ongoing work. I am approaching a reasonable minimal metadata format to address our immediate pain points, that I believe can be used as a starting point for our further work on this, more advanced setup web utility from @joelspadin , etc.
Overview
The PR proposes a standard
${item_id}.zmk.yml
filenaming convention, where the item might be a board, shield, or interconnect. Those files contain a standard YAML structure, and I have also created a JSON schema that can be used to validate these files, e.g.west metadata check
, including a GH Action to perform these checks.Each item has a required
type
property ofboard
,shield
, orinterconnect
. By having a dedicated interconnect file, we can include information about the interconnect without duplicating it, and also achieve "promote a board ID to an interconnect ID" and keep the metadata about both uses distinct.Examples
boards/arm/nrfmicro/nrfmicro_13.zmk.yml
:boards/shields/corne/corne.zmk.yml
:boards/interconnects/pro_micro.zmk.yml
:Hardware Docs Page
Link: https://deploy-preview-883--zmk.netlify.app/docs/hardware
Screenshot:
TODO