diff --git a/myis11/src/IRIS_IS3/IS3Comon.cpp b/myis11/src/IRIS_IS3/IS3Comon.cpp index 674abb5..0de22bc 100644 --- a/myis11/src/IRIS_IS3/IS3Comon.cpp +++ b/myis11/src/IRIS_IS3/IS3Comon.cpp @@ -49,7 +49,7 @@ uint16_t crc16(const uint8_t *data, size_t len, uint16_t polynomial) { uint16_t i, j, tmp, CRC16; - CRC16 = 0xFFFF; // CRC寄存器初始值 + CRC16 = 0xFFFF; // CRC锟侥达拷锟斤拷锟斤拷始值 for (i = 0; i < len; i++) { CRC16 ^= data[i]; @@ -59,7 +59,7 @@ uint16_t crc16(const uint8_t *data, size_t len, uint16_t polynomial) CRC16 >>= 1; if (tmp == 1) { - CRC16 ^= polynomial; // 异或多项式 + CRC16 ^= polynomial; // 锟斤拷锟斤拷锟斤拷式 } } } @@ -71,7 +71,7 @@ size_t SendSettingCommand(u_char Command, size_t CommandLenth, u_char *Value, si int lenthforwrite = IRIS_Protocol_Pack(Command, (uint16_t)ValueLenth, Value, (uint8_t *)BufferFortempWrite); SerialWrite(BufferFortempWrite, lenthforwrite); - // for 5 次 + // for 5 锟斤拷 for (int i = 0; i < 10; i++) { size_t retunnumber = GetInfoBackFromSensorinTime(Command,1000); @@ -84,7 +84,7 @@ size_t SendSettingCommand(u_char Command, size_t CommandLenth, u_char *Value, si } - // 第I次尝试 数据回复异常 数据确实 用英文打印 + // 锟斤拷I锟轿筹拷锟斤拷 锟斤拷锟捷回革拷锟届常 锟斤拷锟斤拷确实 锟斤拷英锟侥达拷印 printf("warning try %d times: date not enough,try again!!\n",i); @@ -100,19 +100,21 @@ size_t SendGetData(int shutter) { uint8_t dataforsend=NONE_DATA; int lenthforwrite=IRIS_Protocol_Pack(GET_DATA_FROM_SENSOR, (uint16_t)01, &dataforsend, (uint8_t *)BufferFortempWrite ); + SerialWrite(BufferFortempWrite, lenthforwrite); for (int i=0;i<10;i++) { - size_t retunnumber = GetInfoBackFromSensorinTime(GET_DATA_FROM_SENSOR,2*shutter+2000); + size_t retunnumber = GetInfoBackFromSensorinTime(GET_DATA_FROM_SENSOR,3*shutter); + //size_t retunnumber = GetInfoBackFromSensorinTime(GET_DATA_FROM_SENSOR,2*shutter+2000); if (retunnumber50 ? 50 : TotalIndexNow; for (int i = 0; i -size_t GetInfoBackFromSensorinTime(uint8_t Command,uint32_t waittime) // big 是指用几个字节表示数据长度 暂时只发现采集数据时用两个字节 +size_t GetInfoBackFromSensorinTime(uint8_t Command,uint32_t waittime) // big 锟斤拷指锟矫硷拷锟斤拷锟街节憋拷示锟斤拷锟捷筹拷锟斤拷 锟斤拷时只锟斤拷锟街采硷拷锟斤拷锟斤拷时锟斤拷锟斤拷锟斤拷锟街斤拷 { - delay(1); - //获取当前电脑时间 + // delay(1); + //锟斤拷取锟斤拷前锟斤拷锟斤拷时锟斤拷 size_t begintime= get_system_uptime_ms(); TotalIndexNow = 0; @@ -221,7 +223,7 @@ size_t GetInfoBackFromSensorinTime(uint8_t Command,uint32_t waittime) // big size_t retrunlenth=SerailRead(BufferForRead + TotalIndexNow, 5-TotalIndexNow); TotalIndexNow += retrunlenth; // if (retrunlenth!=0) { - // //输出bufferforread + // //锟斤拷锟絙ufferforread // for (int i = 0; i < TotalIndexNow; i++) { // printf("%02x ", BufferForRead[i]); // } @@ -252,7 +254,7 @@ size_t GetInfoBackFromSensorinTime(uint8_t Command,uint32_t waittime) // big //delay(10); //delay(10); } - // 输出bufferforread + // 锟斤拷锟絙ufferforread printf("Data from sensor: "); int maxoutput= TotalIndexNow>50 ? 50 : TotalIndexNow; for (int i = 0; i HH3瀹氭爣 + + 鍙嶅皠鐜囪浆iris + +