解决EW写流水号数组越界的bug
解决0x20指令只会解析第一个槽参数的bug ew写延时添加crc8
This commit is contained in:
@@ -1021,8 +1021,9 @@ void EW_Test_ReadSN(void)
|
||||
uint8_t uc_rtv=0;
|
||||
uint8_t addr=9;
|
||||
uint8_t len=4;
|
||||
// 缓存开大一点防止数据越界
|
||||
typedef union{
|
||||
uint8_t arr[4];
|
||||
uint8_t arr[6];
|
||||
uint32_t data;
|
||||
}temp_def;
|
||||
temp_def temp={0};
|
||||
@@ -1057,13 +1058,15 @@ void EW_Test_WriteSN(void)
|
||||
uint8_t uc_rtv=0;
|
||||
uint8_t addr=9;
|
||||
uint8_t len=4;
|
||||
// 缓存开大一点防止数据越界
|
||||
typedef union{
|
||||
uint8_t arr[4];
|
||||
uint8_t arr[6];
|
||||
uint32_t data;
|
||||
}temp_def;
|
||||
temp_def temp={0};
|
||||
uint32_t sn;
|
||||
delay_ms(50);
|
||||
sn=checker_runcfg.params[0]|(checker_runcfg.params[1]<<16);
|
||||
uc_rtv|=EW_ReadMTP(checker_runcfg.netid,addr,temp.arr,len);
|
||||
if(uc_rtv){
|
||||
uc_rtv=1;
|
||||
@@ -1095,9 +1098,10 @@ void EW_Test_WriteDelay(void)
|
||||
{
|
||||
uint8_t uc_rtv=0;
|
||||
uint8_t addr[2]={0x18/4,0xa8/4};
|
||||
uint8_t len=2;
|
||||
uint8_t len=3;
|
||||
// 缓存开大一点防止数据越界
|
||||
typedef union{
|
||||
uint8_t arr[2];
|
||||
uint8_t arr[6];
|
||||
uint16_t data;
|
||||
}temp_def;
|
||||
temp_def temp={0};
|
||||
@@ -1113,6 +1117,7 @@ void EW_Test_WriteDelay(void)
|
||||
// }
|
||||
delay_ms(50);
|
||||
temp.data=delay;
|
||||
temp.arr[2]=CheckCRC_8(temp.arr,2);
|
||||
uc_rtv |= EW_WriteMTP(checker_runcfg.netid,addr[i],temp.arr,len);
|
||||
if(uc_rtv){
|
||||
uc_rtv=2+i;
|
||||
|
Reference in New Issue
Block a user