Skip to content

Commit 5634524

Browse files
author
Amanda Butler
authored
Update config option range in configuration.md
Make changes from #852 to 5.11 branch
1 parent 0a8494b commit 5634524

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

docs/reference/configuration/configuration.md

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,21 +144,39 @@ For example:
144144
"help": "The second configuration parameter",
145145
"required": true
146146
},
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
148163
}
149164
}
150165
```
151166

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`.
153168

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:
155170

156171
- `help`: an optional help message that describes the purpose of the parameter.
157172
- `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.
158176
- `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.
159177
- `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`.
160178

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`.
162180

163181
<span class="notes">**Note:** The name of a parameter in `config` can't contain a dot (`.`) character.</span>
164182

0 commit comments

Comments
 (0)