Use get_u16_str
instead of snprintf
in autoshift_timer_report
#18606
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Including
<string.h>
forsnprintf
takes a considerable amount of firmware space. Using the newly addedget_u16_str
function lets us save some firmware size.To assess the results, I measured the size regression using
./util/size_regression.sh
on multiple keymaps that enable AUTO_SHIFT:As we can see, about 1 kilobyte is saved in average. Lily58/yshrsmz is the only keymap whose size actually increases after applying this patch but I'm not sure why; perhaps
snprintf
is already used elsewhere in his keymap and this patch forces him to compile theget_u16_str
function he previously didn't need.Types of Changes
Issues Fixed or Closed by This PR
Checklist