Skip to content

Commit c06fcaf

Browse files
authored
Merge pull request #13548 from evva-sfw/enhance-minimal-printf
Add width modifier and prepending zeros for hexadecimal output and decimal precision for floating point
2 parents c62b8e5 + 03cf621 commit c06fcaf

File tree

3 files changed

+522
-154
lines changed

3 files changed

+522
-154
lines changed

platform/source/minimal-printf/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
Library supports both printf and snprintf in around 1300 bytes of flash.
55

6-
Prints directly to stdio/UART without using malloc. All flags and precision modifiers are ignored.
6+
Prints directly to stdio/UART without using malloc. Width size and prepending zero modifiers are supported. All other flags are ignored.
77
There is no error handling if a writing error occurs.
88

99
Supports:
@@ -12,10 +12,10 @@ Supports:
1212
* %u: unsigned integer [h, hh, (none), l, ll, z, j, t].
1313
* %x: unsigned integer [h, hh, (none), l, ll, z, j, t], printed as hexadecimal number (e.g., ff).
1414
* %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 (disabled by default). Precision modifier is supported (e.g. %.5f).
16+
* %F: floating point (disabled by default, treated as %f). Precision modifier is supported (e.g. %.5F).
17+
* %g: floating point (disabled by default, treated as %f). Precision modifier is supported (e.g. %.5g).
18+
* %G: floating point (disabled by default, treated as %f). Precision modifier is supported (e.g. %.5G).
1919
* %c: character.
2020
* %s: string.
2121
* %p: pointer (e.g. 0x00123456).

0 commit comments

Comments
 (0)