Date and time with MJD and example usage#38
Open
getSurreal wants to merge 1 commit intomathertel:masterfrom
Open
Date and time with MJD and example usage#38getSurreal wants to merge 1 commit intomathertel:masterfrom
getSurreal wants to merge 1 commit intomathertel:masterfrom
Conversation
mathertel
requested changes
Apr 23, 2020
Owner
mathertel
left a comment
There was a problem hiding this comment.
The intention is welcome and a good extension. See my coments.
| /// Setup the RDS object and initialize private variables to 0. | ||
| RDSParser::RDSParser() { | ||
| RDSParser::RDSParser() | ||
| { |
Owner
There was a problem hiding this comment.
Here and in other places re re-formatting should be reversed to focus on the changes.
| int day; | ||
| int year; | ||
| }; | ||
|
|
Owner
There was a problem hiding this comment.
The MDJ structures and functions should be moved into RDSParser to be available is all sketches.
|
|
||
| void getMJDInfo(uint32_t mjd, MJD_INFO *mjdInfo) | ||
| { | ||
| int _year = (int)((mjd - 15078.2) / 365.25); |
Owner
There was a problem hiding this comment.
Please avoid floating-point arithmetic. I hope you find a pure integer based solution.
| _year = _year + k + 1900; | ||
| _month = _month - 1 - k * 12; | ||
|
|
||
| long WD = (long)((mjd + 2) % 7) + 1; //modulo 7 | Day of the Week |
Owner
There was a problem hiding this comment.
WD is calculated by not used. can be removed or commented.
| typedef void(*receiveServicenNameFunction)(char *name); | ||
| typedef void(*receiveTextFunction)(char *name); | ||
| typedef void(*receiveTimeFunction)(uint8_t hour, uint8_t minute); | ||
| typedef void(*receiveTimeFunction)(uint8_t hour, uint8_t minute, uint32_t MJD, int8_t offset); |
Owner
There was a problem hiding this comment.
Pleas add a new callback function to not break compatibility.
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.
No description provided.