2
2
3
3
Library supports both printf and snprintf in 1252 bytes of flash.
4
4
5
- Prints directly to stdio/UART without using malloc. All flags and precision modifiers are ignored. Floating point is disabled by default.
5
+ Prints directly to stdio/UART without using malloc. All flags and precision modifiers are ignored.
6
+ Floating point is disabled by default.
7
+ Printing to a FILE stream is enabled by default.
6
8
7
9
Supports:
8
10
* %d: signed integer [ h, hh, (none), l, ll, z, j, t] .
9
11
* %i: signed integer [ h, hh, (none), l, ll, z, j, t] .
10
12
* %u: unsigned integer [ h, hh, (none), l, ll, z, j, t] .
11
- * %x: unsigned integer [ h, hh, (none), l, ll, z, j, t] , printed as hexadecimal number (e.g., FF ).
13
+ * %x: unsigned integer [ h, hh, (none), l, ll, z, j, t] , printed as hexadecimal number (e.g., ff ).
12
14
* %X: unsigned integer [ h, hh, (none), l, ll, z, j, t] , printed as hexadecimal number (e.g., FF).
13
15
* %f: floating point (disabled by default).
14
- * %F: floating point (disabled by default).
15
- * %g: floating point (disabled by default).
16
- * %G: 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 ).
17
19
* %c: character.
18
20
* %s: string.
19
21
* %p: pointer (e.g. 0x00123456).
20
22
23
+ Unrecognized format specifiers are treated as ordinary characters.
24
+
25
+ Floating point support:
26
+ * Floating point is disabled by default.
27
+ * All floating points are treated as %f.
28
+ * No support for inf, infinity or nan
29
+
21
30
To replace the standard implementations of the printf functions with the ones in this library:
22
31
23
32
* Add the library to your project.
@@ -28,7 +37,7 @@ To replace the standard implementations of the printf functions with the ones in
28
37
$ mbed compile -t <toolchain> -m <target> --profile mbed-printf/profiles/release.json
29
38
```
30
39
31
- ## Enabling floating point, 64 bit integers, new line conversion, and setting baud rate
40
+ ## Enabling floating point, FILE stream, 64 bit integers, new line conversion, and setting baud rate
32
41
33
42
In mbed_app.json:
34
43
@@ -37,7 +46,8 @@ In mbed_app.json:
37
46
"*": {
38
47
"platform.stdio-baud-rate": 115200,
39
48
"platform.stdio-convert-newlines": false,
40
- "minimal-printf.enable-floating-point": false,
49
+ "minimal-printf.enable-file-stream": true,
50
+ "minimal-printf.enable-floating-point": true,
41
51
"minimal-printf.set-floating-point-max-decimals": 6,
42
52
"minimal-printf.enable-64-bit": true
43
53
}
0 commit comments