Skip to content

Reduce serial hook binary footprint.#20911

Merged
thinkyhead merged 1 commit intoMarlinFirmware:bugfix-2.0.xfrom
X-Ryl669:tmpSH2
Jan 29, 2021
Merged

Reduce serial hook binary footprint.#20911
thinkyhead merged 1 commit intoMarlinFirmware:bugfix-2.0.xfrom
X-Ryl669:tmpSH2

Conversation

@X-Ryl669
Copy link
Contributor

Description

Reduce the binary size of my serial hooking code, as spotted by @thinkyhead .
Without this PR, I had:

Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [========= ]  88.9% (used 58248 bytes from 65536 bytes)
Flash: [========= ]  86.9% (used 455740 bytes from 524288 bytes)
encrypt([".pio/build/mks_robin_nano35/debug/firmware.bin"], [".pio/build/mks_robin_nano35/debug/firmware.elf"])

After the PR, I now have:

Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [========= ]  88.9% (used 58248 bytes from 65536 bytes)
Flash: [========= ]  86.1% (used 451500 bytes from 524288 bytes)
encrypt([".pio/build/mks_robin_nano35/debug/firmware.bin"], [".pio/build/mks_robin_nano35/debug/firmware.elf"])

It also fix RuntimeHook connected call loop

Requirements

None

Benefits

Reduce binary flash size by 4.2kB on my system at the cost of a bit less inlining of the serial code's print and write functions.

Configurations

None

Related Issues

PR #20783 last comment from Scott.

Fix RuntimeHook connected loop
@thinkyhead
Copy link
Member

thinkyhead commented Jan 29, 2021

I agree that optimizing to code for size is much more valuable than optimizing for some miniscule performance gain in an area that's not a performance bottleneck (such as serial output).

@thinkyhead thinkyhead merged commit 9e004a9 into MarlinFirmware:bugfix-2.0.x Jan 29, 2021
X-Ryl669 added a commit to X-Ryl669/MarlinForMKS that referenced this pull request Jan 31, 2021
Jyers pushed a commit to Jyers/Marlin that referenced this pull request Feb 3, 2021
kpishere pushed a commit to kpishere/Marlin that referenced this pull request Feb 19, 2021
zillarob pushed a commit to zillarob/Marlin that referenced this pull request Feb 25, 2021
W4tel-BiDi pushed a commit to W4tel-BiDi/Marlin that referenced this pull request Apr 5, 2021
thinkyhead pushed a commit to thinkyhead/Marlin that referenced this pull request Apr 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants