Skip to content
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

The RTCC_TimeGet() function of plib_rtcc.c does not use a standard tm struct. #72

Open
JTRodri opened this issue May 13, 2024 · 0 comments

Comments

@JTRodri
Copy link

JTRodri commented May 13, 2024

In the function:
void RTCC_TimeGet( struct tm Time )
from the harmony library (plib_rtcc.c)
The tm_year field according to the standard is:
int tm_year; /the years since 1900/
However, in this function this variable is set to an exact value of year 0.
So if the standard is followed with this function we get errors.
It would only be necessary to change line 175:
....
//tmp += 2000U; /
This RTC is designed for a range of 0 to 99 years. You have to add 2000 to that. */
tmp += 100U; //To adjust the structure to standard time it is necessary to add 2000 and subtract 1900 from this field. That is, add 100.
Time->tm_year = (int)tmp;
....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant