Skip to content

Commit 2462082

Browse files
author
Amanda Butler
authored
Update config_system.md
Fix header sizes
1 parent f4d7859 commit 2462082

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

docs/advanced/config_system.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ The mbed configuration system customizes the compile time configuration of vario
99

1010
The configuration system gathers and interprets all the configurations defined in the source tree. The output of the configuration system is a list of macros that are automatically defined when compiling the code.
1111

12-
# Defining configuration parameters
12+
## Defining configuration parameters
1313

1414
The configuration system understands configuration data defined in targets, libraries and applications. Although there are some slight differences in the way the configuration system works in these cases, the configuration parameters are always defined in a JSON object called "config".
1515

@@ -49,7 +49,7 @@ The configuration system automatically appends an *implicit prefix* to the name
4949
- **app.** if the parameter is defined in the application.
5050
- The name of the library followed by a dot (.) if the parameter is defined in a library.
5151

52-
# Configuration data in libraries
52+
## Configuration data in libraries
5353

5454
Each mbed library can have an optional `mbed_lib.json` file located in the root folder of the library that defines its configuration. For a library called `mylib`, the configuration file can look like this:
5555

@@ -103,7 +103,7 @@ As explained [here](#defining-configuration-parameters), the parameters have an
103103

104104
If the source tree has code for more than one library, each library needs its own `mbed_lib.json` file in its root folder.
105105

106-
# Configuration data in targets
106+
## Configuration data in targets
107107

108108
Like libraries, targets can define their own configuration data. Additionally, targets can override the configuration of the target(s) they inherit from (for more details about how do define a target and target inheritance, check [this link](mbed_targets.md)). Target configuration data is defined in `targets.json` using `config`, as described [here](#defining-configuration-parameters). An example for a hypothetical `Base` target is given below:
109109

@@ -152,7 +152,7 @@ Targets can inherit from other targets, and their configuration data is also inh
152152

153153
It is an error for a derived target to redefine a configuration parameter already defined by its parent(s) in its `config` section. It is also an error for a derived target to override a configuration parameter that was not defined by its parent(s) in its `overrides` section.
154154

155-
# Configuration data in applications
155+
## Configuration data in applications
156156

157157
Like target and library configuration, application configuration is optional; if it exists, it must be defined in an `mbed_app.json` file. Unlike library configuration, there can be a single `mbed_app.json` file in the source tree.
158158

@@ -203,7 +203,7 @@ Other than this, `target_overrides` works exactly like it does for libraries. Ke
203203

204204
It is an error for the application configuration to override configuration parameters that were not defined.
205205

206-
## Overriding target attributes
206+
### Overriding target attributes
207207

208208
Target configurations contain a set of attributes that you may manipulate with an application configuration. You may override these attributes as if they were a normal configuration parameter. If these attributes are cumulative, you may also manipulate them with the special `attribute_add` and `attribute_remove` meta-attributes.
209209

@@ -226,7 +226,7 @@ For example, this `mbed_app.json` disables the IPV4 feature; using this network
226226
}
227227
```
228228

229-
# Configuration data precedence
229+
## Configuration data precedence
230230

231231
The order in which the various bits of configurations are considered is:
232232

@@ -247,7 +247,7 @@ For `myapp` above:
247247
- 128 and 20, respectively, because `Derived` defines the `NXP` label and `mylib` defines a specific configuration for this label.
248248
- Because `Derived` has its own `my_own_config` configuration parameter, `target.my_own_config` will also be defined in this case.
249249

250-
# Using configuration data in the code
250+
## Using configuration data in the code
251251

252252
When compiling, the configuration system will automatically generate macro definitions for the configuration parameters and all the macros defined in libraries and the application in their `macros` keys. These definitions will be written in a file named `mbed_config.h`, located in the build directory. When compiling `myapp` for target `Base`, the `mbed_config.h` file will look like this (note that the order of the definitions may be different):
253253

0 commit comments

Comments
 (0)