-
Notifications
You must be signed in to change notification settings - Fork 1
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
NCD-343: Read configuration, merge with defaults, show in GUI #36
Conversation
cybic
commented
Feb 6, 2024
- Read configuration from firmware, using nrfutil-device commands in shared.
- Wrap configuration and merge with boards defaults from the board definition file
- Set current hardware configuration in state to update GUI
Make sure to add the "doc required" or "doc not required" label. |
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.
I also noticed that you use {}
as the default/empty state for the hardwareConfig.
I don't know the internals but just wanted to know if this was on purpose.
There were some shorthand booleans related to the hardwareConfig but not exactly this type. I'm just wary because {}
would equate to true.
if (!device) { | ||
return; | ||
} |
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.
How can the device here be undefined?
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.
Removed the check - I came to the same conclusion as you.
await getBoardControllerVersion(dispatch, device); // FIXME: Remove this when onDeviceIsReady() is called | ||
await getCurrentBoardControllerConfig(dispatch, device); // FIXME: Remove this when onDeviceIsReady() is called |
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.
Guess this isn't important, I just don't understand the reason for why not.
But you can also wrap this within dispatch and change the definition for the functions to be
const x = (y) => dispatch => {}
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.
I have looked into this briefly earlier with Ådne, although I didn't change it. I'll look into it later on.
Doc: https://nordicsemi.atlassian.net/browse/NCD-722 @cybic , what exactly needs to be documented in the Board Controller docs? |
The Board Configurator will now read the config from the board and merge it with the defaults from the board definition file. |
It was done on purpose, and I don't think it's a problem it being truthy. Anyway I've altered the default return to a more correct object (The pins map should always be present, I think) |