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
* %x: unsigned integer [h, hh, (none), l, ll, z, j, t], printed as hexadecimal number (e.g., ff).
14
14
* %X: unsigned integer [h, hh, (none), l, ll, z, j, t], printed as hexadecimal number (e.g., FF).
15
-
* %f: floating point (disabled by default).
16
-
* %F: floating point (disabled by default, treated as %f).
17
-
* %g: floating point (disabled by default, treated as %f).
18
-
* %G: floating point (disabled by default, treated as %f).
15
+
* %f: floating point (enabled by default).
16
+
* %F: floating point (enabled by default, treated as %f).
17
+
* %g: floating point (enabled by default, treated as %f).
18
+
* %G: floating point (enabled by default, treated as %f).
19
19
* %c: character.
20
20
* %s: string.
21
21
* %p: pointer (e.g. 0x00123456).
@@ -28,6 +28,7 @@ Floating point limitations:
28
28
29
29
## Usage
30
30
31
+
As of Mbed OS 6.0 this is enabled by default. To replace the standard implementation of the printf functions with the ones in this library for older versions of Mbed:
31
32
32
33
To replace the standard implementation of the printf functions with the ones in this library:
33
34
@@ -43,6 +44,17 @@ Modify your application configuration file to override the parameter `target.pri
43
44
}
44
45
```
45
46
47
+
If your application requires more advanced functionality, you'll need to revert to using standard version of printf/snprintf. Please note that it will result in significant ROM usage increase. In case you are using minimal version of standard C library advanced functionality may not be present.
48
+
49
+
Modify your application configuration in `mbed_app.json` file to override the parameter `target.printf_lib` with the value `std` as shown below:
50
+
51
+
```json
52
+
"target_overrides": {
53
+
"*": {
54
+
"target.printf_lib": "std"
55
+
}
56
+
}
57
+
```
46
58
47
59
## Configuration
48
60
@@ -59,7 +71,7 @@ Minimal printf is configured by the following parameters defined in `platform/mb
59
71
},
60
72
"minimal-printf-enable-floating-point": {
61
73
"help": "Enable floating point printing when using minimal-printf profile",
"help": "Maximum number of decimals to be printed",
@@ -69,7 +81,7 @@ Minimal printf is configured by the following parameters defined in `platform/mb
69
81
}
70
82
```
71
83
72
-
By default, 64 bit integers support is enabled.
84
+
By default, 64 bit integers and floating point support is enabled.
73
85
74
86
If your target does not require some options then you can override the default configuration in your application `mbed_app.json` and achieve further memory optimisation (see next section for size comparison numbers).
0 commit comments