summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorStefan Kerkmann <karlk90@pm.me>2022-04-22 10:13:31 +0200
committerGitHub <noreply@github.com>2022-04-22 18:13:31 +1000
commitb1681fb6a11e6eb286bc93af3bcc59422e054eb8 (patch)
treec1d41030249f2d187eca4f11281765ef9e78567f /docs
parent68a3fe8347ff76e96075dab17cb9c4ac81ecf634 (diff)
[Core] Allow usage of AVRs minimal printf library (#16266)
Co-authored-by: Sergey Vlasov <sigprof@gmail.com>
Diffstat (limited to 'docs')
-rw-r--r--docs/squeezing_avr.md13
1 files changed, 13 insertions, 0 deletions
diff --git a/docs/squeezing_avr.md b/docs/squeezing_avr.md
index 62f0a5d290..f7e21d932b 100644
--- a/docs/squeezing_avr.md
+++ b/docs/squeezing_avr.md
@@ -30,6 +30,19 @@ MAGIC_ENABLE = no
These features are enabled by default, but may not be needed. Double check to make sure, though.
Largest in size is "magic" -- the QMK magic keycodes -- which control things like NKRO toggling, GUI and ALT/CTRL swapping, etc. Disabling it will disable those functions.
+If you use `sprintf` or `snprintf` functions you can save around ~400 Bytes by enabling this option.
+```make
+AVR_USE_MINIMAL_PRINTF = yes
+```
+
+This will include smaller implementations from AVRs libc into your Firmware. They are [not fully featured](https://www.nongnu.org/avr-libc/user-manual/group__avr__stdio.html#gaa3b98c0d17b35642c0f3e4649092b9f1), for instance zero padding and field width specifiers are not supported. So if you use `sprintf` or `snprintf` like this:
+```c
+sprintf(wpm_str, "%03d", get_current_wpm());
+snprintf(keylog_str, sizeof(keylog_str), "%dx%d, k%2d : %c");
+```
+
+you will still need the standard implementation.
+
## `config.h` Settings
If you've done all of that, and you don't want to disable features like RGB, Audio, OLEDs, etc, there are some additional options that you can add to your config.h that can help.