V2.09 使用任务插槽设置电阻校准值成功
This commit is contained in:
@@ -214,7 +214,7 @@ array_def *elec_bootinfo(void)
|
||||
board_st.resistor_diff=sys_param()->resistor_diff;
|
||||
//board_st.hard_v=rt_tick_get()/1000;
|
||||
board_st.hard_v=HARD_VERSION;
|
||||
board_st.soft_v=(int)(str_atof(SOFT_VERSION)*100);
|
||||
board_st.soft_v=(int)(str_atof(SOFT_VERSION)*100+0.5);
|
||||
array_def *r=arr_creat();
|
||||
arr_append(r,0);
|
||||
arr_appends(r,&board_st,sizeof(BoartCheck_st));
|
||||
@@ -629,3 +629,33 @@ array_def *elec_code(array_def *uid_psw)
|
||||
|
||||
|
||||
|
||||
// 执行任务插槽
|
||||
array_def *elec_check_slot(void)
|
||||
{
|
||||
self_def *s=&g_self;
|
||||
s->task_par=0;
|
||||
s->chip_type=0;
|
||||
uint8_t taskid=0;
|
||||
uint8_t res=0;
|
||||
s->task_index=0;
|
||||
array_def *r=arr_creat();
|
||||
res=checker_runcfg.power_prapare_exe;
|
||||
memset(&checker_runcfg,0,sizeof(Checker_RunCfg_st));
|
||||
checker_runcfg.power_prapare_exe=res;
|
||||
|
||||
checker_runcfg.param_count=1;
|
||||
checker_runcfg.params[0]=1;
|
||||
CheckerExt_Slot();
|
||||
|
||||
elec_judge_def *e=malloc(sizeof(elec_judge_def));
|
||||
elec_judge(e,s->task_num,checker_runcfg.Task_Result,
|
||||
checker_runcfg.Task_Excute,
|
||||
(uint8_t *)checker_runcfg.Test_Rtv,&res,0);
|
||||
free(e);
|
||||
arr_append(r,res);
|
||||
return arr_temp(r);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -38,7 +38,7 @@ array_def *elec_check_with_scheme(array_def *uid_psw);
|
||||
|
||||
array_def *elec_code(array_def *uid_psw);
|
||||
|
||||
|
||||
array_def *elec_check_slot(void);
|
||||
|
||||
int elec_check_load_task_param(uint8_t task_index);
|
||||
|
||||
|
@@ -33,9 +33,12 @@ typedef struct{
|
||||
|
||||
|
||||
|
||||
static task_slot_def *g_task_slot;
|
||||
|
||||
void task_slot_delete(void)
|
||||
{
|
||||
task_slot_def *t=app_variable("task_slot",0,0);
|
||||
//task_slot_def *t=app_variable("task_slot",0,0);
|
||||
task_slot_def *t=g_task_slot;
|
||||
if(t){
|
||||
task_node *n=t->head;
|
||||
task_node *old=0;
|
||||
@@ -46,18 +49,21 @@ void task_slot_delete(void)
|
||||
}
|
||||
free(t);
|
||||
}
|
||||
g_task_slot=0;
|
||||
}
|
||||
|
||||
|
||||
// 初始化
|
||||
void *task_slot_init(void)
|
||||
{
|
||||
task_slot_def *t=app_variable("task_slot",0,0);
|
||||
//task_slot_def *t=app_variable("task_slot",0,0);
|
||||
task_slot_def *t=g_task_slot;
|
||||
if(t==0){
|
||||
t=calloc(1,sizeof(task_slot_def));
|
||||
app_variable("task_slot",t,0);
|
||||
// app_variable("task_slot",t,0);
|
||||
}
|
||||
t->current=t->head;
|
||||
g_task_slot=t;
|
||||
return t;
|
||||
}
|
||||
|
||||
@@ -73,7 +79,7 @@ int task_slot_add_item(void *context,task_def *item)
|
||||
task_node **n=&t->head;
|
||||
task_node *tail;
|
||||
tail=calloc(1,sizeof(task_node));
|
||||
memcpy(tail,item,sizeof(task_node));
|
||||
memcpy(&tail->task,item,sizeof(task_def));
|
||||
while(*n){
|
||||
n=&(*n)->next;
|
||||
}
|
||||
|
@@ -208,8 +208,19 @@ void CheckerExt_Slot(void)
|
||||
|
||||
|
||||
|
||||
/*rc{
|
||||
|
||||
|
||||
写电阻校准值
|
||||
par0:电阻校准值
|
||||
ret:无
|
||||
}*/
|
||||
void CheckerExt_SetCbv(void)
|
||||
{
|
||||
int cbv=checker_runcfg.params[0];
|
||||
int self_index=checker_runcfg.task_info.runindex;
|
||||
elec_write_resistor_cbv(cbv);
|
||||
Checker_MaskResult(0,self_index);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -220,5 +231,6 @@ CheckerTask exttaskArray[CHECKER_EXTID_COUNT]={
|
||||
CheckerExt_Repeat,
|
||||
CheckerExt_SetUID,
|
||||
CheckerExt_Slot,
|
||||
CheckerExt_SetCbv,
|
||||
};
|
||||
|
||||
|
@@ -23,7 +23,7 @@ void CheckerExt_SetUID(void);
|
||||
|
||||
void CheckerExt_Slot(void);
|
||||
|
||||
|
||||
void CheckerExt_SetCbv(void);
|
||||
|
||||
|
||||
|
||||
|
@@ -966,6 +966,31 @@ void EW_Test_VerifyUID(void)
|
||||
|
||||
|
||||
|
||||
// 读mtp
|
||||
void EW_Test_ReadMTP(void)
|
||||
{
|
||||
uint8_t uc_rtv=0;
|
||||
uint8_t addr=checker_runcfg.params[0];
|
||||
uint8_t len=checker_runcfg.params[1];
|
||||
delay_ms(50);
|
||||
uc_rtv|EW_ReadMTP(checker_runcfg.netid,addr,EW_RunBuf,len);
|
||||
Checker_SetRtv((uint16_t *)EW_RunBuf,checker_runcfg.rtv_count);
|
||||
Checker_MaskResult(uc_rtv,checker_runcfg.task_info.runindex);
|
||||
}
|
||||
// 写mtp
|
||||
void EW_Test_WriteMTP(void)
|
||||
{
|
||||
uint8_t uc_rtv=0;
|
||||
uint8_t addr=checker_runcfg.params[0];
|
||||
uint8_t len=checker_runcfg.params[1];
|
||||
delay_ms(50);
|
||||
memcpy(EW_RunBuf,&checker_runcfg.params[1],len);
|
||||
uc_rtv |= EW_WriteMTP(checker_runcfg.netid,addr,EW_RunBuf,len);
|
||||
Checker_MaskResult(uc_rtv,checker_runcfg.task_info.runindex);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -986,6 +1011,10 @@ void EW_Empty(void)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
CheckerTask ewtaskArray[CHECKER_MAXID_COUNT] ={
|
||||
Checker_PowerPrapare, //0 电源准备
|
||||
Checker_WaitDelay, //1 延时等待
|
||||
@@ -1022,6 +1051,9 @@ EW_Test_WriteUID, //31 写入三码数据
|
||||
EW_Test_VerifyUID, //32 验证三码数据
|
||||
CheckerExt_SetUID, //33 配置三码数据到小板
|
||||
CheckerExt_Slot, //34 任务插槽
|
||||
EW_Test_ReadMTP, //35 读取mtp
|
||||
EW_Test_WriteMTP, //36 写入mtp
|
||||
CheckerExt_SetCbv, //37 设置电阻校准值
|
||||
(void*)0 //数组结束
|
||||
};
|
||||
|
||||
|
@@ -4,6 +4,7 @@
|
||||
#include "base/utility.h"
|
||||
#include "hardware/power.h"
|
||||
#include "JQChecker.h"
|
||||
#include "CheckerExt.h"
|
||||
|
||||
/*
|
||||
@brief 统计模块的上电充能,具有电压设置功能,采集档位 R10_0p1mA_1p6mA_UC
|
||||
@@ -1264,6 +1265,7 @@ CheckerExt_CalcErr ,//39 计算异常
|
||||
CheckerExt_Repeat ,//40 重新执行任务
|
||||
CheckerExt_SetUID ,//41 设置uid数据到小板
|
||||
CheckerExt_Slot ,//42 任务插槽
|
||||
CheckerExt_SetCbv ,//43 设置电阻校准值
|
||||
(void*)0 //数组结束
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user