Microchip-MPLAB-Harmony / csp

Harmony 3 Chip Support Package
https://onlinedocs.microchip.com/v2/keyword-lookup?keyword=MH3_csp&redirect=true
Other
34 stars 22 forks source link

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

Open JTRodri opened 5 months ago

JTRodri commented 5 months ago

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