Skip to content

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

@JTRodri

Description

@JTRodri

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;
....

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions