22
33Library supports both printf and snprintf in 1252 bytes of flash.
44
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.
68
79Supports:
810* %d: signed integer [ h, hh, (none), l, ll, z, j, t] .
911* %i: signed integer [ h, hh, (none), l, ll, z, j, t] .
1012* %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 ).
1214* %X: unsigned integer [ h, hh, (none), l, ll, z, j, t] , printed as hexadecimal number (e.g., FF).
1315* %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 ).
1719* %c: character.
1820* %s: string.
1921* %p: pointer (e.g. 0x00123456).
2022
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+
2130To replace the standard implementations of the printf functions with the ones in this library:
2231
2332* Add the library to your project.
@@ -28,7 +37,7 @@ To replace the standard implementations of the printf functions with the ones in
2837$ mbed compile -t <toolchain> -m <target> --profile mbed-printf/profiles/release.json
2938```
3039
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
3241
3342In mbed_app.json:
3443
@@ -37,7 +46,8 @@ In mbed_app.json:
3746 "*": {
3847 "platform.stdio-baud-rate": 115200,
3948 "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,
4151 "minimal-printf.set-floating-point-max-decimals": 6,
4252 "minimal-printf.enable-64-bit": true
4353 }
0 commit comments