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/reference/configuration/configuration.md
+22-4Lines changed: 22 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -144,21 +144,39 @@ For example:
144
144
"help": "The second configuration parameter",
145
145
"required": true
146
146
},
147
-
"param3": 10
147
+
"param3": {
148
+
"help": "The third configuration parameter",
149
+
"value_min": 0,
150
+
"value_max": 10,
151
+
"value": 5
152
+
},
153
+
"param4": {
154
+
"help": "The fourth configuration parameter",
155
+
"accepted_values": ["test1", "test2", "0x1000"],
156
+
"value": "test2"
157
+
},
158
+
"param5": {
159
+
"help": "The fifth configuration parameter",
160
+
"value": null
161
+
},
162
+
"param6": 10
148
163
}
149
164
}
150
165
```
151
166
152
-
You define a configuration parameter by specifying its name as the key and specifying its value either with a description object or by value. The JSON fragment above defines three configuration parameters named `param1`, `param2`and `param3`.
167
+
You define a configuration parameter by specifying its name as the key and specifying its value either with a description object or by value. Leaving the value field undefined or setting the value field to `null` allows the parameter to be stored as a configuration option and appear with the `mbed compile --config` command; however, the key is not be defined in `mbed_config.h` and does not affect the application or OS unless it is overridden. See `param2` and `param5` for examples of this. The JSON fragment above defines six configuration parameters named `param1`, `param2`, `param3`, `param4`, `param5`and `param6`.
153
168
154
-
Above, the configuration parameters `param1`and `param2` are defined using a description object. The description object supports the following keys:
169
+
Above, the configuration parameters `param1`through `param5` are defined using a description object. The description object supports the following keys:
155
170
156
171
-`help`: an optional help message that describes the purpose of the parameter.
157
172
-`value`: an optional field that defines the value of the parameter.
173
+
-`value_min`: an optional field that defines the minimum acceptable value of the parameter.
174
+
-`value_max`: an optional field that defines the maximum acceptable value of the parameter.
175
+
-`accepted_values`: an optional field that defines a list of acceptable values for the parameter.
158
176
-`required`: an optional key that specifies whether the parameter must have a value before compiling the code (`false` by default). It's not possible to compile a source tree with one or more required parameters that don't have a value. Generally, setting `required` to true is only useful when `value` is not set.
159
177
-`macro_name`: an optional name for the macro defined at compile time for this configuration parameter. The configuration system automatically figures out the corresponding macro name for a configuration parameter, but the user can override this automatically computed name by specifying `macro_name`.
160
178
161
-
You define a macro by value by using an integer or string instead of the description object, such as `param3` above. Defining a parameter by value is equivalent to a configuration parameter defined with a description object with the key `value` set to the value in place of the description object, the key `help` unset, the key `macro_name` unset, and the key `required` set to `false`.
179
+
You define a macro by value by using an integer or string instead of the description object, such as `param6` above. Defining a parameter by value is equivalent to a configuration parameter defined with a description object with the key `value` set to the value in place of the description object, the key `help` unset, the key `macro_name` unset, and the key `required` set to `false`.
162
180
163
181
<spanclass="notes">**Note:** The name of a parameter in `config` can't contain a dot (`.`) character.</span>
0 commit comments