diff --git a/rtos/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S530.h b/rtos/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S530.h index 4d3478ca2..820bd7fed 100644 --- a/rtos/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S530.h +++ b/rtos/code/application/source/cardv/SrcCode/PrjCfg_HUNTING_S530.h @@ -983,6 +983,7 @@ #define SF_BATTERY_TEST DISABLE #define SF_BATTERY_TEST_FILE "A:\\BATTERY.TXT" +#define SF_HW_TEST_FILE "A:\\HW.TXT" #define SF_HW_TEST DISABLE ////////////////////sf end//////////////////////////////// diff --git a/rtos/code/driver/na51089/include/sf_mcu.h b/rtos/code/driver/na51089/include/sf_mcu.h index 445121db7..fcdda2447 100644 --- a/rtos/code/driver/na51089/include/sf_mcu.h +++ b/rtos/code/driver/na51089/include/sf_mcu.h @@ -524,5 +524,6 @@ void sf_mcu_flag_clear_done(MCU_FLAG_INIT boot_init); UINT32 sf_get_send_pic_sieze(void); void sf_para_print(void); UINT8 sf_convert_power_on_mode(void); +void sf_hw_info_save(char *name); #endif diff --git a/rtos/code/driver/na51089/source/mcu/sf_mcu.c b/rtos/code/driver/na51089/source/mcu/sf_mcu.c index 4e249f09a..49491a602 100644 --- a/rtos/code/driver/na51089/source/mcu/sf_mcu.c +++ b/rtos/code/driver/na51089/source/mcu/sf_mcu.c @@ -2229,6 +2229,11 @@ void sf_add_file_name_to_send_list(char *sendfname) memcpy(str1, sendfname + 4, 4); sf_BatteryInfoSave(str1); #endif +#if SF_HW_TEST == ENABLE + char str2[5] = { 0 }; + memcpy(str2, sendfname + 4, 4); + sf_hw_info_save(str2); +#endif } /************************************************* @@ -2256,6 +2261,53 @@ void sf_para_print(void) printf("%s:%d isUsb = %d isCard = %d isCardFull = %d simCardInsert = %ld start mode = %d IRSHTTER = %d\n",__FUNCTION__,__LINE__, isUsb, isCard, isCardFull, simCardInsert, PowerOnMode, IRSHTTER); } +#if SF_HW_TEST == ENABLE + +void sf_hw_info_save(char *name) +{ + char *tmpBuf = NULL; + //UINT32 LibatAdc = 0; + //UINT32 batAdc = 0; + + //char fileName[64] = {0}; + int fd = 0; + //struct stat st; + + tmpBuf = malloc(512); + + if (tmpBuf == NULL) { + printf("%s:%d tmpBuf malloc err\n", __FUNCTION__, __LINE__); + return; + } + + //snprintf(fileName, sizeof(fileName), "%s", SF_HW_TEST_FILE); + + if(access(SF_HW_TEST_FILE, F_OK) == 0) + { + printf("fileName:%s\n",SF_HW_TEST_FILE); + fd = open(SF_HW_TEST_FILE, O_APPEND | O_WRONLY); + } + else { + fd = open(SF_HW_TEST_FILE, O_APPEND | O_WRONLY | O_CREAT); + } + + + sprintf(tmpBuf, "%s IRSHTTER=%d\r\n", name, IRSHTTER); + printf("%s\r", tmpBuf); + + if(fd) + { + //fstat(fd, &st); + lseek(fd, 0, SEEK_END); + write(fd, tmpBuf, strlen(tmpBuf)); + close(fd); + //printf("Add Success st_size:%ld\n", st.st_size); + } + free(tmpBuf); +} + +#endif + #if defined __FREERTOS int sf_mod_init(void)