解决检测后立即赋码会直接返回成功的bug

This commit is contained in:
ranchuan
2023-10-25 20:47:04 +08:00
parent 965674dd2c
commit 40050fe571
9 changed files with 36 additions and 18 deletions

View File

@@ -299,7 +299,7 @@
<OPTFL> <OPTFL>
<tvExp>1</tvExp> <tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
<IsCurrentTarget>0</IsCurrentTarget> <IsCurrentTarget>1</IsCurrentTarget>
</OPTFL> </OPTFL>
<CpuCode>18</CpuCode> <CpuCode>18</CpuCode>
<DebugOpt> <DebugOpt>
@@ -529,7 +529,7 @@
<OPTFL> <OPTFL>
<tvExp>1</tvExp> <tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
<IsCurrentTarget>1</IsCurrentTarget> <IsCurrentTarget>0</IsCurrentTarget>
</OPTFL> </OPTFL>
<CpuCode>18</CpuCode> <CpuCode>18</CpuCode>
<DebugOpt> <DebugOpt>
@@ -1501,7 +1501,7 @@
<Group> <Group>
<GroupName>rt_thread</GroupName> <GroupName>rt_thread</GroupName>
<tvExp>1</tvExp> <tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg> <tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel> <cbSel>0</cbSel>
<RteFlg>0</RteFlg> <RteFlg>0</RteFlg>

View File

@@ -224,3 +224,5 @@
添加cmd_printf 函数不会自动添加换行符 添加cmd_printf 函数不会自动添加换行符
2023.10.23 2023.10.23
XT模块读取工厂信息测试命令返回读取结果 XT模块读取工厂信息测试命令返回读取结果
2023.10.25
解决检测后立即赋码会直接返回成功的bug

View File

@@ -161,6 +161,15 @@ array_def *elec_check_result(void)
} }
// 清除检测结果
void elec_check_result_clear(void)
{
self_def *s=&g_self;
CHECK_DO(s->data,arr_delete);
}
// 写硬件版本号 // 写硬件版本号
array_def *elec_write_hardversion(int version) array_def *elec_write_hardversion(int version)
{ {
@@ -371,7 +380,7 @@ array_def *elec_check_with_scheme(array_def *uid_psw)
CheckerTask task_fun=0; CheckerTask task_fun=0;
uint8_t res=0; uint8_t res=0;
array_def *r=arr_creat(); array_def *r=arr_creat();
CHECK_DO(s->data,arr_delete); //CHECK_DO(s->data,arr_delete);
res=checker_runcfg.power_prapare_exe; res=checker_runcfg.power_prapare_exe;
memset(&checker_runcfg,0,sizeof(Checker_RunCfg_st)); memset(&checker_runcfg,0,sizeof(Checker_RunCfg_st));
checker_runcfg.power_prapare_exe=res; checker_runcfg.power_prapare_exe=res;
@@ -444,7 +453,7 @@ array_def *elec_code(array_def *uid_psw)
array_def *r=arr_creat(); array_def *r=arr_creat();
uint8_t ret=0; uint8_t ret=0;
int check_ret=0; int check_ret=0;
CHECK_DO(s->data,arr_delete); //CHECK_DO(s->data,arr_delete);
check_ret=elec_code_param_check(uid_psw); check_ret=elec_code_param_check(uid_psw);
if(check_ret!=0){ if(check_ret!=0){
arr_append(r,1); arr_append(r,1);

View File

@@ -20,6 +20,8 @@ array_def *elec_bootinfo(void);
array_def *elec_check_result(void); array_def *elec_check_result(void);
void elec_check_result_clear(void);
array_def *elec_write_hardversion(int version); array_def *elec_write_hardversion(int version);
array_def *elec_write_resistor_cbv(int cbv); array_def *elec_write_resistor_cbv(int cbv);

View File

@@ -532,10 +532,10 @@ void JQ_Test_ChgEnergy(void)
} }
us_timeout--; us_timeout--;
} }
if(us_end_cur > us_chgend_cur) // if(us_end_cur > us_chgend_cur)
{ // {
uc_rtv = 1; // uc_rtv = 1;
} // }
CurrentSampleR_Def; CurrentSampleR_Def;
Checker_MaskResult(uc_rtv,checker_runcfg.task_info.runindex); Checker_MaskResult(uc_rtv,checker_runcfg.task_info.runindex);
us_array[0] = us_energy; us_array[0] = us_energy;

View File

@@ -306,10 +306,10 @@ void XT_Test_ChgEnergy(void)
} }
us_timeout--; us_timeout--;
} }
if(us_end_cur > us_chgend_cur) // if(us_end_cur > us_chgend_cur)
{ // {
uc_rtv = 1; // uc_rtv = 1;
} // }
CurrentSampleR_Def; CurrentSampleR_Def;
Checker_MaskResult(uc_rtv,checker_runcfg.task_info.runindex); Checker_MaskResult(uc_rtv,checker_runcfg.task_info.runindex);
us_array[0] = us_energy; us_array[0] = us_energy;

View File

@@ -6,8 +6,8 @@
#define BUILD_DATE "2023-10-23 15:26:13" #define BUILD_DATE "2023-10-25 16:38:07"
#define SOFT_VERSION "2.01" #define SOFT_VERSION "2.02"

View File

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

View File

@@ -200,7 +200,12 @@ static int check_dolater(ucport_def *u,uint8_t cmd,array_def *data,char *err_str
}else{ }else{
arr_append(r,2); arr_append(r,2);
} }
emit tran_reply_signal(u->p,arr_temp(r)); elec_check_result_clear();
if(c->cmd==cmd){
emit tran_reply_signal(u->p,arr_temp(r));
}else{
arr_delete(r);
}
return 0; return 0;
} }
@@ -214,7 +219,6 @@ static ucport_def *check_self(tran_def *t, uint8_t cmd,array_def *data,
u->u.del=slave_del; u->u.del=slave_del;
u->u.dolater=check_dolater; u->u.dolater=check_dolater;
c->check_fun=fun; c->check_fun=fun;
u->u.dolater(&u->u,cmd,data,"ok"); u->u.dolater(&u->u,cmd,data,"ok");
return (ucport_def *)u; return (ucport_def *)u;
} }
@@ -243,6 +247,7 @@ transmit_export(ym_slave,0x17,check_code)
static int stop_submit_dolater(ucport_def *u,uint8_t cmd,array_def *data,char *err_str) static int stop_submit_dolater(ucport_def *u,uint8_t cmd,array_def *data,char *err_str)
{ {
g_check.submit_running=0; g_check.submit_running=0;
g_check.cmd=0;
array_def *r=arr_creat(); array_def *r=arr_creat();
arr_append(r,0); arr_append(r,0);
emit tran_reply_signal(u->p,arr_temp(r)); emit tran_reply_signal(u->p,arr_temp(r));