修复连续采集时没有时间间隔导致通讯失败从而导致无有法正常连续采集的问题 修改如下

This commit is contained in:
xin
2025-03-31 13:53:00 +08:00
parent a3ac3b3ec1
commit 164ba745a3
3 changed files with 22 additions and 2 deletions

View File

@ -11,6 +11,22 @@
// #define MYCOMAN 0x02 //命令全大写
// todo : define your protocol here
/*-------------------------------------------------------------------------------------------------------------*/
#define GET_BASIC_INFO 0x50
#define SET_INTEGRAL_TIME 0x51
#define SET_AUTO_EXPOSURE 0x52
#define GET_INTEGRAL_TIME_AND_DATA_PROCESS 0x53
#define GET_TEMPRETURE 0x54
#define SET_SHUTTER_OPEN 0x55
#define SET_SHUTTER_CLOSE 0x56
#define GET_BANDNUMBER 0x57
#define SET_WEAVE_COEFF 0x58
#define GET_WEAVE_COEFF 0x59
#define SET_DATA_PROCESS_METHOD 0x60
#define GET_DATA_FROM_SENSOR 0x61
#define NONE_DATA 0x00

View File

@ -104,6 +104,9 @@ int32_t IRIS_Cut_Befor_Header(uint8_t *PackData, uint16_t LenthofIn) {
if (PackData == NULL) {
return ERROR_INPUT;
}
if (LenthofIn <2) {
return LenthofIn;
}
uint16_t i = 0;
for (i = 0; i < LenthofIn; i++) {
if (PackData[i] == 0x55 && PackData[i + 1] == 0xAA) {

View File

@ -1,5 +1,5 @@
/**
******************************************************************************
******************************************************************************
* @file : IRIS_Method.h
* @author : xin
* @brief : None
@ -20,7 +20,8 @@
#define ERROR_COMMAND -400
#define ERROR_INPUT -500
#define ERROR_CRC -600
#include <stdint.h>
//#include<Arduino.h>
// 成功返回打包后的数据长度
// -1: Error