Skip to content

Commit

Permalink
Update Ref_Printf.md
Browse files Browse the repository at this point in the history
  • Loading branch information
SpenceKonde committed Aug 16, 2023
1 parent a84e67e commit 783c5f0
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions megaavr/extras/Ref_Printf.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,9 @@ Notice that there is no line for 64 bit types in the table above; these are not
There are reports of memory corruption with printf suspect it is misunderstandign of above that is actually at hand here.

### General notes about DxC/mTC and printf()'y things.
* No matter how you come to printing with a format string, it's gonna end up pulling in all the same bloat. Most of the `[1-2 letters]printf()` functions are little more than wrappers around various ways of supplying input to using the output from master algorithm.
Note that using this method will pull in just as much bloat as `sprintf()` and is subject to the same limitations as printf - by default, floating point values aren't printed. You can use this with all serial ports
You can choose to have a full `printf()` implementation from a Tools submenu if you want to print floating point numbers, at a cost of some additional flash.
-lprintf_min
No matter how you come to printing with a format string, it's gonna end up pulling in all the same bloat. Most of the `[1-2 letters]printf()` functions are little more than wrappers around various ways of supplying input to using the output from master algorithm.

You can choose to have a full `printf()` implementation from a Tools submenu if you want to print floating point numbers, at a cost of some additional flash.

#### Selectable `printf()` Implementation
A Tools submenu lets you choose from three levels of `printf()`: full `printf()` with all features, the default one that drops float support to save 1k of flash, and the minimal one drops almost everything and for another 450 bytes flash saving (will be a big deal on the 16k and 8k parts. Less so on 128k ones). Note that selecting any non-default option here *will cause it to be included in the binary even if it's never called* - and if it's never called, it normally wouldn't be included. So an empty sketch will take more space with minimal `printf()` selected than with the default, while a sketch that uses `printf()` will take less space with minimal `printf()` vs default.

0 comments on commit 783c5f0

Please sign in to comment.