Changeset 470


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

時刻の計算を修正

Location:
azure_iot_hub_f767zi/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • azure_iot_hub_f767zi/trunk/app_iothub_client/src/command.c

    r457 r470  
    5757"          CUP command            cup   control\n"
    5858"          IOT                    connect azure\n"
    59 "          CS             set connection string\n"
     59"          SETCS          set connection string\n"
    6060"          CSGEN               provision device\n"
    6161"          PROXY                  set proxy    \n"
  • azure_iot_hub_f767zi/trunk/asp_baseplatform/OBJ/STM32F767NUCLEO144_GCC/MAC/lwip_test.c

    r457 r470  
    255255        gmtime_r(&current_time, &current_time_val);
    256256        printf("%04d/%02d/%02d %02d:%02d:%02d\n",
    257                 current_time_val.tm_year+1900, current_time_val.tm_mon, current_time_val.tm_mday,
     257                current_time_val.tm_year+1970, current_time_val.tm_mon, current_time_val.tm_mday,
    258258                current_time_val.tm_hour, current_time_val.tm_min, current_time_val.tm_sec);
    259259}
  • azure_iot_hub_f767zi/trunk/asp_baseplatform/pdic/stm32f7xx/clock.c

    r464 r470  
    217217                timedate.tm_mday = 1;
    218218        printf("%04d/%02d/%02d\n", arg1, timedate.tm_mon, timedate.tm_mday);
    219         timedate.tm_year = arg1-1900;
     219        timedate.tm_year = arg1-1970;
    220220        timedate.tm_isdst = 0;
    221221        mktime((struct tm *)&timedate);
     
    291291        }
    292292        mktime(&timedate);
    293         printf("  %04d/%02d/%02d yday[%d]\n", timedate.tm_year+1900, timedate.tm_mon, timedate.tm_mday, timedate.tm_yday);
     293        printf("  %04d/%02d/%02d yday[%d]\n", timedate.tm_year+1970, timedate.tm_mon, timedate.tm_mday, timedate.tm_yday);
    294294        printf("    %02d:%02d:%02d wday[%d]\n", timedate.tm_hour, timedate.tm_min, timedate.tm_sec, timedate.tm_wday);
    295295        return 0;
  • 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.