-
Notifications
You must be signed in to change notification settings - Fork 178
Update documentation for target definitions #398
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
Conversation
This doesnt show in the rendered HTML, but helps when editing the file and when viewing it through github
goes along with ARMmbed/mbed-os#5910
Adds some much-needed documentation on how to use the `config` key when defining a new target, as well as overriding it in other targets or in the mbed_app.json file
Copy edit for active voice, consistent tense and formatting.
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.
@drewcassidy Thanks for the update. I've left a few questions for you to address.
docs/tools/mbed_targets.md
Outdated
@@ -148,6 +149,40 @@ The build system errors when you use features outside of this list. | |||
|
|||
When you use target inheritance, you may alter the values of `features` using `features_add` and `features_remove`. This is similar to the `macros_add` and `macros_remove` mechanism the previous section describes. | |||
|
|||
#### `config` and `overrides` | |||
|
|||
_configs_ provide a more flexible way to manage macros for a target. Each configuration has a macro name, as well as a default value and an optional help value. For example, this config flag defines a configuration `lf_clock_src` that defines the source for the low frequency clock on the nRF51 target, with a default value of `NRF_LF_SRC_XTAL`. Compiling sets this value for the macro `MBED_CONF_NORDIC_NRF_LF_CLOCK_SRC`: |
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.
Query: In "a more flexible way", what are we comparing this to? More flexible than what?
Also, could you please clarify the third sentence? When we say "this config flag," are we talking about the example starting on line 156 or something else?
Also, is this example specific to the nRF51, or does it work with other boards, too?
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 was referencing the section of the style guide below on why modules and boards shouldnt use macros
. The example is just a config definition I pulled from the NRF51 target, but I'll replace it with something more generic. I should probably move the explanation after the example
docs/tools/mbed_targets.md
Outdated
} | ||
``` | ||
|
||
_overrides_ allow a child target to change the value of a config. For example, if a child target of the nRF51 uses the internal RC clock instead of the crystal, it can add an override: |
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.
Query: Is this example specific to the nRF51, or does it work for other boards, too?
update description of the `config` flag to remove anything specific to the nRF51, as well as moving explanations after example snippets
docs/tools/mbed_targets.md
Outdated
@@ -290,9 +330,9 @@ For each of these target roles, some restrictions are in place: | |||
- `extra_labels`. | |||
- `public`. | |||
- `config`. | |||
- `override` |
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.
isn't this overrides
(s missing in here) ?
docs/tools/mbed_targets.md
Outdated
} | ||
``` | ||
|
||
This case defines the config `clock_src`, for the `CLOCK_SRC` macro, and has a default value of `XTAL`. |
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.
wouldn't be easier to show here default naming convention for config and also mention that macro_name overrides it ?
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.
ah, I didnt even realize it defaults to the config name.
clarify that configs default to their name for the macro they apply to, and use the same example configs throughout the section
docs/tools/mbed_targets.md
Outdated
} | ||
} | ||
``` | ||
|
||
This case defines the config `clock_src`, for the `CLOCK_SRC` macro, and has a default value of `XTAL`. | ||
This case defines the config `clock_src` with the default value of `XTAL` for the macro `CLOCK_SRC`, and the config `clock_freq` with the default value of 16 for the macro `CLOCK_FREQUENCY_MHZ`. |
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.
have you tested it ? Ibelieve the default name for clock_src value will be MBED_CONF_CLOCK_SRC
?
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 didnt realize there was a standardized macro for that
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.
would something like the bluetooth advertising name be a better example maybe?
So while trying to find a better config example I found this page from the older docs, should we just reuse the same thing? it looks like its still up to date or, actually there is this page which should probably just be expanded and linked from the targets page |
We do have this page about the configuration system: https://os.mbed.com/docs/v5.7/tools/configuring-tools.html Would it make sense to link to it from the mbed_targets page? |
ah, yeah I just found that. That would probably make sense with just a brief description of the system in it's a bit hard to find these documentation pages through google because of all the older versions showing up. I'm wonder if there should be a change to the docs website's |
Add link to config page and copy edit file for active voice and consistent tense across docs.
@drewcassidy I've added the link to the config page. I also changed this to point to our test site (the new_engine branch), so we can test it before we make it live. Could you please rebase this to resolve the merge conflicts? |
Make changes from PR #398 to new_engine, so they go to the test site for review.
Closing because I'm copying these changes against new_engine |
Adds some much-needed documentation on how to use the
config
key whendefining a new target, as well as overriding it in other targets or in
the mbed_app.json file