Skip to content

Conversation

@getSurreal
Copy link

No description provided.

Copy link
Owner

@mathertel mathertel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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()
{
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here and in other places re re-formatting should be reversed to focus on the changes.

int day;
int year;
};

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pleas add a new callback function to not break compatibility.

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