-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
[Cleanup] Reduce build size + clean up loose ends #3655
Merged
TD-er
merged 33 commits into
letscontrolit:mega
from
TD-er:bugfix/Uninitialized_variables
May 28, 2021
Merged
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
100d588
[Cleanup] Fix warnings of some uninitialised variables.
TD-er 8d006a8
[Docs] Document %iswifi% system environment variable
TD-er d320092
[Domoticz MQTT] Move JSON serialize/deserialize to helper .h/.cpp
TD-er 535e81c
[Cleanup] Reduce build size handle internal commands macros
TD-er 0047e49
[GPIO] Split duplicate code into shared function to reduce build size
TD-er 8b29429
[Rules] Remove unused parameter & change event parameter to const
TD-er ac5d0b9
[WiFi] Remove unneeded log connection status
TD-er d21721d
[Cleanup] Remove code duplication to reduce build size
TD-er 113ec46
[Cleanup] Stream JSON from PROGMEM LabelType::Enum array to reduce size
TD-er 5ee2e33
[Cleanup] Do not include DNS server in minimal OTA builds to reduce size
TD-er 92768a3
[Cleanup] Reduce build size by keeping flash strings as flash string
TD-er a5fab90
[Cleanup] Optimise streaming JSON
TD-er 3965abc
[Cleanup] Add FlashStringHelper function wrappers to reduce build size
TD-er dcaf9f3
[Cleanup] Add missing F() macro where applicable
TD-er 9c363dc
[Serial log] Small optimization to reduce build size + process logs
TD-er 54bf060
[Cleanup] Add small optimisations to reduce build size
TD-er 99f72cc
[Cleanup] Change return type of static get string functions to flash …
TD-er 62424b6
[Cleanup] Reduce build size of parseStandardConversions function
TD-er be3e503
[Cleanup] Reduce build size using flash strings in selectors
TD-er ba3e473
[Cleanup] Fix build error due to missing change in commit.
TD-er 3074df6
[Cleanup] Change return type of some commands to FlashString
TD-er b56a919
[Cleanup] Remove unneeded String() wrappers
TD-er 8dfc246
[Cleanup] Remove "new rules" from any build
TD-er 1f40cd1
[Cleanup] Domoticz MQTT, generate own JSON, not using ArduinoJSON lib
TD-er cd35a3e
[Cleanup] Serialize JSON not using ArduinoJSON to reduce build size
TD-er e3f65c1
[Cleanup] Use EMPTY_STRING instead of F("") to reduce build size
TD-er 3d8a505
[Cleanup] Reduce build size for Factory Default device name
TD-er 79a3271
[Cleanup] Fix build issue on Serial Proxy
TD-er e739486
[Cleanup] Add more functions with flash string as parameter to reduce…
TD-er 1c7cd15
[Cleanup] Add wrapper to web_server.arg() with flash string arg
TD-er 2dcdcc7
[Cleanup] Remove addLog macro and use separate functions per type
TD-er 0140419
Fix new introduced bug in htmlEscape function
TD-er bfbabf7
[DeviceModel] Change to enum class to allow compiler help check usage
TD-er File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a generic improvement, simply replace all
F("")
byEMPTY_STRING
? Or does it require a__FlashStringHelper
reference?(If so then I'll start updating that in my work in progress 😉)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, it is slightly more complex :)
For those functions that return a
String
object, this is an optimization as you don't need to create a String object, but simply reference a static const existing one.But it is a bigger reduction in size if you can create functions that return a flash string instead of having code for every assignment of a flash string to a
String
object.e.g. a typical
toString
function:This return will effectively generate
return String(F("bla"));
for every flash string return calls.By returning a flash string type, you only cast it to
String
after the function is called. (or not at all if it can be kept as a flash string)For example the webserver markup function calls that now also accept a flash string array, which only holds a pointer instead of allocating memory for the string only to dump it to the TXBuffer object, which also can handle flash strings without conversion.
That's the true change of this PR.