Skip to content

Commit f695f4f

Browse files
committed
Update config description
update description of the `config` flag to remove anything specific to the nRF51, as well as moving explanations after example snippets
1 parent 1c60daf commit f695f4f

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

docs/tools/mbed_targets.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -151,26 +151,29 @@ When you use target inheritance, you may alter the values of `features` using `f
151151

152152
#### `config` and `overrides`
153153

154-
_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`:
154+
The list of _configs_ provide a way to modify the values of macros in child targets or in a project. Each configuration has a macro name, as well as a default value and an optional help value. For example:
155155

156156
```json
157157
"config": {
158-
"lf_clock_src": {
159-
"value": "NRF_LF_SRC_XTAL",
160-
"macro_name": "MBED_CONF_NORDIC_NRF_LF_CLOCK_SRC"
158+
"clock_src": {
159+
"help": "Clock source to use, can be XTAL or RC",
160+
"value": "XTAL",
161+
"macro_name": "CLOCK_SRC"
161162
}
162163
}
163164
```
164165

165-
_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:
166+
This case defines the config `clock_src`, for the `CLOCK_SRC` macro, and has a default value of `XTAL`.
167+
168+
_overrides_ allow a child target to change the value of a config. For example, if a child target uses the internal RC clock instead of the crystal, it can add an override:
166169

167170
```json
168171
"overrides": {
169-
"lf_clock_src": "NRF_LF_SRC_RC"
172+
"clock_src": "RC"
170173
}
171174
```
172175

173-
You can also modify a project's configurations in the `mbed_app.json file` by using `target_overrides`.
176+
Config values can also be modified for a project using the `target_overrides` key in the `mbed_app.json` file, either for specific targets or as a wildcard. For example:
174177

175178
```json
176179
"target_overrides": {
@@ -183,6 +186,8 @@ You can also modify a project's configurations in the `mbed_app.json file` by us
183186
}
184187
```
185188

189+
This section, in an `mbed_app.json` file, will set a value for `config1` on all targets, as well as a value for `config2` only on the `NRF51_DK` target.
190+
186191
#### `device_has`
187192

188193
The list in `device_has` defines what hardware a device has.

0 commit comments

Comments
 (0)