添加扩展任务 用于小板端执行异常判定
ew程序下载批量验证成功
This commit is contained in:
78
source/elec_det/interface/CheckerExt.c
Normal file
78
source/elec_det/interface/CheckerExt.c
Normal file
@@ -0,0 +1,78 @@
|
||||
|
||||
#include "stdlib.h"
|
||||
#include "dev_flash.h"
|
||||
#include "elec_judge.h"
|
||||
#include "CheckerExt.h"
|
||||
#include "basechecker.h"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 扩展的检测任务,这个文件下的任务是所有模块通用的
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*rc{
|
||||
计算异常
|
||||
par0:忽略的异常代码1
|
||||
par1:忽略的异常代码2
|
||||
par2~par9:同上
|
||||
return:无
|
||||
exe:如果计算的异常代码为不被忽略的异常,则此任务失败
|
||||
}*/
|
||||
static int calc_contain(uint16_t *arr,int arr_len,uint16_t item);
|
||||
void CheckerExt_CalcErr(void)
|
||||
{
|
||||
const scheme_def *sch=check_scheme();
|
||||
elec_judge_def *e=0;
|
||||
uint8_t marerr=0,suberr=0;
|
||||
if(sch->plan_id==0xffffffff){
|
||||
// 判定任务不存在,返回失败
|
||||
marerr=6;
|
||||
goto end;
|
||||
}
|
||||
e=malloc(sizeof(elec_judge_def));
|
||||
elec_judge(e,sch->task_num,checker_runcfg.Task_Result,
|
||||
checker_runcfg.Task_Excute,
|
||||
(uint8_t *)checker_runcfg.Test_Rtv,&marerr,&suberr);
|
||||
free(e);
|
||||
|
||||
end:
|
||||
if((marerr!=0)&&(calc_contain(checker_runcfg.params,checker_runcfg.param_count,marerr)==0)){
|
||||
Checker_MaskResult(1,checker_runcfg.task_info.runindex);
|
||||
}else{
|
||||
Checker_MaskResult(0,checker_runcfg.task_info.runindex);
|
||||
}
|
||||
}
|
||||
static int calc_contain(uint16_t *arr,int arr_len,uint16_t item)
|
||||
{
|
||||
for(int i=0;i<arr_len;i++){
|
||||
if(arr[i]==item)
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*rc{
|
||||
重新执行已执行的任务,
|
||||
任务执行结果会覆盖之前执行的那次,参数也使用之前的那个参数
|
||||
通过此任务调用的任务错误跳转无效
|
||||
par0:要执行的任务序号
|
||||
return:无
|
||||
exe:如果要执行的任务序号不小于此任务则此任务失败
|
||||
}*/
|
||||
//void CheckerExt_Repeat
|
||||
|
||||
|
||||
CheckerTask exttaskArray[CHECKER_EXTID_COUNT]={
|
||||
CheckerExt_CalcErr,
|
||||
};
|
||||
|
Reference in New Issue
Block a user