saving DateTime object's memory#4
Open
solamyl wants to merge 5 commits into
Open
Conversation
reduced sizeof(DateTime) object from 18 bytes => 6 bytes. definition of `daysInMonth` array must be in separate .cpp file, otherwise its content is copied into each class instance.
it is always good practice to have the default constructor as minimal as possible. Constructor DateTime(uint32_t) is too complex.
with these simple and straightforward classes it makes no sense to have a copy constructor but do not have assignment operator
added const to the methods where missing
datatypes uint8/16/32_t declared in Wire.h
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Hi Hideaki,
I was looking for some DS3231 library and found yours. In the end I didn't use it but I used the
DataTimeclass which I have found handy :-)BUT: unfortunately there were some unpleasant imperfections which I have fixed in this patch.
Changes:
constto the methods where was missingThere were no functional changes.
I have tested it against all examples and with my code and is working fine.
thank you in advance,
-- stepan