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

NCD-343: Read configuration, merge with defaults, show in GUI #36

Merged
merged 9 commits into from
Feb 8, 2024

Conversation

cybic
Copy link
Contributor

@cybic 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

Copy link

github-actions bot commented Feb 6, 2024

Make sure to add the "doc required" or "doc not required" label.

@cybic cybic added the doc required This PR includes user-facing changes that need to be documented. label Feb 6, 2024
Copy link
Contributor

@boundlesscalm boundlesscalm left a 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.

src/SidePanel.tsx Outdated Show resolved Hide resolved
src/app/DeviceSelector.tsx Show resolved Hide resolved
Comment on lines +102 to +104
if (!device) {
return;
}
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Comment on lines +67 to +68
await getBoardControllerVersion(dispatch, device); // FIXME: Remove this when onDeviceIsReady() is called
await getCurrentBoardControllerConfig(dispatch, device); // FIXME: Remove this when onDeviceIsReady() is called
Copy link
Contributor

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 => {}

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 have looked into this briefly earlier with Ådne, although I didn't change it. I'll look into it later on.

@greg-fer
Copy link
Contributor

greg-fer commented Feb 7, 2024

Doc: https://nordicsemi.atlassian.net/browse/NCD-722

@cybic , what exactly needs to be documented in the Board Controller docs?

@cybic
Copy link
Contributor Author

cybic commented Feb 7, 2024

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.

@cybic
Copy link
Contributor Author

cybic commented Feb 7, 2024

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.

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)

@cybic cybic merged commit cb65d6a into main Feb 8, 2024
1 check passed
@cybic cybic deleted the NCD-343_new_read_config branch February 8, 2024 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc required This PR includes user-facing changes that need to be documented.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants