Ignore:
Timestamp:
Jun 27, 2021, 10:08:56 PM (3 years ago)
Author:
coas-nagasima
Message:

時刻の計算を修正

File:
1 edited

Legend:

Unmodified
Added
Removed
  • azure_iot_hub_f767zi/trunk/asp_baseplatform/pdic/stm32f7xx/device.c

    r464 r470  
    11581158        SVC_PERROR(wai_sem(RTCSEM));
    11591159
    1160         datetmp = (((uint32_t)byte2bcd(pt->tm_year) << 16) |
    1161                                 ((uint32_t)byte2bcd(pt->tm_mon + 1) << 8) |
     1160        datetmp = (((uint32_t)byte2bcd(pt->tm_year - 30) << 16) |
     1161                                ((uint32_t)byte2bcd(pt->tm_mon) << 8) |
    11621162                                ((uint32_t)byte2bcd(pt->tm_mday)) |
    11631163                                ((uint32_t)pt->tm_wday << 13));
     
    12441244         */
    12451245        datetmp = sil_rew_mem((uint32_t *)(TADR_RTC_BASE+TOFF_RTC_DR)) & RTC_DR_RESERVED_MASK;
    1246         pt->tm_year = (uint8_t)bcd2byte((uint8_t)((datetmp & (RTC_DR_YT | RTC_DR_YU)) >> 16));
    1247         pt->tm_mon = (uint8_t)bcd2byte((uint8_t)((datetmp & (RTC_DR_MT | RTC_DR_MU)) >> 8)) - 1;
     1246        pt->tm_year = (uint8_t)bcd2byte((uint8_t)((datetmp & (RTC_DR_YT | RTC_DR_YU)) >> 16)) + 30;
     1247        pt->tm_mon = (uint8_t)bcd2byte((uint8_t)((datetmp & (RTC_DR_MT | RTC_DR_MU)) >> 8));
    12481248        pt->tm_mday = (uint8_t)bcd2byte((uint8_t)(datetmp & (RTC_DR_DT | RTC_DR_DU)));
    12491249        pt->tm_wday = (uint8_t)((datetmp & (RTC_DR_WDU)) >> 13);
Note: See TracChangeset for help on using the changeset viewer.