diff --git a/rtos/code/driver/na51089/source/mcu/sf_mcu.c b/rtos/code/driver/na51089/source/mcu/sf_mcu.c index 49491a602..19180f944 100644 --- a/rtos/code/driver/na51089/source/mcu/sf_mcu.c +++ b/rtos/code/driver/na51089/source/mcu/sf_mcu.c @@ -2273,6 +2273,12 @@ void sf_hw_info_save(char *name) int fd = 0; //struct stat st; + struct tm drRtcTime; + + UIMenuStoreInfo *pPara = sf_ui_para_get(); + char datestr[30] = { 0 }; + + tmpBuf = malloc(512); if (tmpBuf == NULL) { @@ -2280,6 +2286,23 @@ void sf_hw_info_save(char *name) return; } + drRtcTime = hwclock_get_time(TIME_ID_CURRENT); + + if(pPara->DateStyle == SF_DATE_TIME_YYMMDD) + { + sprintf(datestr, "%d/%02d/%02d/%02d :%02d:%02d", drRtcTime.tm_year, drRtcTime.tm_mon, drRtcTime.tm_mday, drRtcTime.tm_hour, drRtcTime.tm_min, drRtcTime.tm_sec); + } + else if (pPara->DateStyle == SF_DATE_TIME_MMDDYY) + { + sprintf(datestr, "%02d/%02d/%d %02d:%02d:%02d", drRtcTime.tm_mon, drRtcTime.tm_mday, drRtcTime.tm_year, drRtcTime.tm_hour, drRtcTime.tm_min, drRtcTime.tm_sec); + } + else + { + sprintf(datestr, "%02d/%02d/%d %02d:%02d:%02d", drRtcTime.tm_mday, drRtcTime.tm_mon, drRtcTime.tm_year,drRtcTime.tm_hour, drRtcTime.tm_min, drRtcTime.tm_sec); + } + //printf("[%s:%d]customStr:%s\n", __FUNCTION__, __LINE__, datestr); + + //snprintf(fileName, sizeof(fileName), "%s", SF_HW_TEST_FILE); if(access(SF_HW_TEST_FILE, F_OK) == 0) @@ -2292,7 +2315,7 @@ void sf_hw_info_save(char *name) } - sprintf(tmpBuf, "%s IRSHTTER=%d\r\n", name, IRSHTTER); + sprintf(tmpBuf, "%s %s IRSHTTER=%d TemperAdc=%lu\r\n", datestr, name, IRSHTTER, sf_get_temper_adc()); printf("%s\r", tmpBuf); if(fd)