You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/tools/mbed_targets.md
+12-7Lines changed: 12 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -151,26 +151,29 @@ When you use target inheritance, you may alter the values of `features` using `f
151
151
152
152
#### `config` and `overrides`
153
153
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:
155
155
156
156
```json
157
157
"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"
161
162
}
162
163
}
163
164
```
164
165
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:
166
169
167
170
```json
168
171
"overrides": {
169
-
"lf_clock_src": "NRF_LF_SRC_RC"
172
+
"clock_src": "RC"
170
173
}
171
174
```
172
175
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:
174
177
175
178
```json
176
179
"target_overrides": {
@@ -183,6 +186,8 @@ You can also modify a project's configurations in the `mbed_app.json file` by us
183
186
}
184
187
```
185
188
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
+
186
191
#### `device_has`
187
192
188
193
The list in `device_has` defines what hardware a device has.
0 commit comments