-
Notifications
You must be signed in to change notification settings - Fork 13.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow disabling global Serial and Serial1 object #2807
allow disabling global Serial and Serial1 object #2807
Conversation
allow the user to disable specific global `Serial` objects to save memory. that's 0x1c bytes per object.
Codecov Report
@@ Coverage Diff @@
## master #2807 +/- ##
========================================
Coverage ? 27.8%
========================================
Files ? 20
Lines ? 3625
Branches ? 656
========================================
Hits ? 1008
Misses ? 2441
Partials ? 176 Continue to review full report at Codecov.
|
I think the "arduino" way of doing this is to move each object's definition into a separate cpp file. Then the objects which aren't used anywhere will not be linked into the output file. I don't particularly mind the approach taken in this MR though... |
I took this approach because others does, too. Such as SSDP and MDNS... |
in platformio.ini, |
@Palatis thank you, that way is expected. I thought there's some "Arduino Way of doing this" |
"the Arduino way of doing this" is leave them there and hope they get stripped by the linker... i guess... |
It can't be stripped since it is a global variable with a constructor.
(next to |
allow the user to disable specific global
Serial
objects to savememory.
that's 0x1c bytes per object.