V2.12 sn为0时如果未写流水号则报错
This commit is contained in:
@@ -24,7 +24,7 @@ void CtrlGpio_DefInit(void)
|
||||
GPIO_ResetBits(GPIOA,GPIO_InitStructure.GPIO_Pin);
|
||||
|
||||
GPIO_InitStructure.GPIO_Pin = SEG0_Pin;
|
||||
//GPIO_InitStructure.GPIO_Mode=GPIO_Mode_IN_FLOATING;
|
||||
// GPIO_InitStructure.GPIO_Mode=GPIO_Mode_IN_FLOATING;
|
||||
GPIO_InitStructure.GPIO_Mode=GPIO_Mode_IPD;
|
||||
GPIO_Init(GPIOA,&GPIO_InitStructure);
|
||||
|
||||
@@ -91,7 +91,7 @@ uint8_t Gpio_GetDeivceAddr(void)
|
||||
ul_addr |= ((PCin(SEG1_Pin_Nu) & 0x01) <<1);
|
||||
ul_addr |= (PAin(SEG0_Pin_Nu) & 0x01);
|
||||
return ul_addr;
|
||||
// return 1;
|
||||
// return 7;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -1049,6 +1049,12 @@ void EW_Test_ReadSN(void)
|
||||
temp.data>>=5;
|
||||
if((sn!=0)&&(temp.data!=sn)){
|
||||
uc_rtv=3;
|
||||
goto end;
|
||||
}
|
||||
// sn为0时如果没写过流水号则失败
|
||||
if((sn==0)&&(temp.data==0)){
|
||||
uc_rtv=4;
|
||||
goto end;
|
||||
}
|
||||
end:
|
||||
Checker_SetRtv((uint16_t *)&temp,checker_runcfg.rtv_count);
|
||||
@@ -1081,11 +1087,18 @@ void EW_Test_WriteSN(void)
|
||||
uc_rtv=2;
|
||||
goto end;
|
||||
}
|
||||
// 流水号域如果有值且不为要设置的流水号则失败
|
||||
if((temp.data&(~0x1f))!=0){
|
||||
if((temp.data>>5)!=sn){
|
||||
uc_rtv=3;
|
||||
}
|
||||
goto end;
|
||||
}
|
||||
delay_ms(50);
|
||||
temp.data=(temp.data&0x1f)|(sn<<5);
|
||||
uc_rtv |= EW_WriteMTP(checker_runcfg.netid,addr,temp.arr,len);
|
||||
if(uc_rtv){
|
||||
uc_rtv=3;
|
||||
uc_rtv=4;
|
||||
goto end;
|
||||
}
|
||||
end:
|
||||
|
@@ -1326,6 +1326,12 @@ void JQ_Test_ReadSN(void)
|
||||
temp.data>>=5;
|
||||
if((sn!=0)&&(temp.data!=sn)){
|
||||
uc_rtv=3;
|
||||
goto end;
|
||||
}
|
||||
// sn为0时如果没写过流水号则失败
|
||||
if((sn==0)&&(temp.data==0)){
|
||||
uc_rtv=4;
|
||||
goto end;
|
||||
}
|
||||
|
||||
end:
|
||||
|
Reference in New Issue
Block a user