Part Number: CCSTUDIO-MSP
Tool/software: TI C/C++ Compiler
IDE: CCS 6.1
Compiler: TI v4.4.3
MCU: MSP430FR5989
--------------------------
unit_8 rtc_c_rtc2utc(time_t *utc_time)
{
unit_8 rtc_c_value[RTC_ARRAY_SIZE];
struct tm rtc_tm;
rtc_c_read_cale(rtc_c_value);
rtc_tm.tm_sec = rtc_c_value[6];
rtc_tm.tm_min = rtc_c_value[5];
rtc_tm.tm_hour = rtc_c_value[4];
rtc_tm.tm_mday = rtc_c_value[3] + 1;
rtc_tm.tm_mon = rtc_c_value[2] - 1;
rtc_tm.tm_year = rtc_c_value[0] * 256 + rtc_c_value[1] - 1970;
rtc_tm.tm_isdst = -1;
*utc_time = mktime(&rtc_tm) - LOCAL_TIMEZONE;
return 0;
}
------------------------
1. After complie the program above, the advise "(ULP 15.1) Detected consecutive bitfield assigns. Recommend using bit mask instead" occured 6 times during the line of "rtc_tm.tm_min = rtc_c_value[5];" and "rtc_tm.tm_isdst = -1;", But I can't understand where I have used the bitfield assigns?
2. In time.h, it shows below:
-----------------
struct tm
{
.....
int tm_mday; /* day of the month - [1,31] */
...
int tm_year; /* years since 1900 */
.....
};
----------------
But actually I must adds current day of the month with 1 and minus current year with 1970 to get correct UTC time. I've read the link
But I can't find where to add or remove __TI_TIME_USES_64.