V2.12 sn为0时如果未写流水号则报错

This commit is contained in:
ranchuan
2024-01-04 18:09:09 +08:00
parent 1e25675998
commit 78e0ebd0c2
7 changed files with 30 additions and 26 deletions

View File

@@ -322,3 +322,5 @@
EW_Updata 添加错误12表示小板中无jwt程序
2024.01.03
V2.11 读流水号时如果目标值为0则不报错
2021.01.04
V2.12 sn为0时如果未写流水号则报错

View File

@@ -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;
}

View File

@@ -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:

View File

@@ -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:

View File

@@ -6,8 +6,8 @@
#define BUILD_DATE "2024-01-03 15:32:33"
#define SOFT_VERSION "2.11"
#define BUILD_DATE "2024-01-04 14:39:32"
#define SOFT_VERSION "2.12"

View File

@@ -7,7 +7,7 @@ import mycopy
# 定义软件版本号
SOFT_VERION = "2.11"
SOFT_VERION = "2.12"