取消急停时如果不在空闲状态才跳到另一侧
心跳数据在收到回复之后也会继续发送 芯片异常时不检测电容 str_is_print_str 函数中,len为0时返回0 改版本号为0.03
This commit is contained in:
@@ -208,6 +208,16 @@ static void process_err(void *arg)
|
||||
}
|
||||
}
|
||||
|
||||
// 上报异常字符串
|
||||
static void process_send_errstr(void *arg,int errcode,const char *errstr)
|
||||
{
|
||||
self_def *s=arg;
|
||||
int errlen=strlen(errstr);
|
||||
array_def *a=arr_creat();
|
||||
arr_append(a,errcode);
|
||||
arr_appends(a,errstr,errlen);
|
||||
process_send_signal(s,0x8c,arr_temp(a));
|
||||
}
|
||||
|
||||
// 急停按钮响应函数
|
||||
static void process_stop(void *arg)
|
||||
@@ -217,6 +227,7 @@ static void process_stop(void *arg)
|
||||
// 管壳挡板,0是挡住
|
||||
SET_OUTPUT(OUTPUT_SHELL_BAFFLE,0);
|
||||
SET_ERR_TIMES(3);
|
||||
process_send_errstr(s,8,"急停");
|
||||
DBG_LOG("stop key pressed.");
|
||||
}
|
||||
static void process_run(void *arg)
|
||||
@@ -225,6 +236,11 @@ static void process_run(void *arg)
|
||||
s->stop_state=0;
|
||||
s->busy=0;
|
||||
SET_LED_OFF();
|
||||
// 不在空闲状态时跳转到另一侧
|
||||
if(CHECK_STEP(s->step,idle)==0){
|
||||
RESET_STEP(s->step);
|
||||
}
|
||||
process_send_errstr(s,9,"取消急停");
|
||||
DBG_LOG("stop key unpressed.");
|
||||
}
|
||||
|
||||
@@ -389,11 +405,13 @@ static void process_end_slot(void *obj,int ack,array_def *data)
|
||||
|
||||
// 400ms 后开始打标
|
||||
void process_mark_start(void *arg);
|
||||
later_execute(process_mark_start,s,400);
|
||||
later_execute(process_mark_start,s,300);
|
||||
|
||||
// 5s 后打标结束
|
||||
void process_mark_end(void *arg);
|
||||
later_execute(process_mark_end,s,5000);
|
||||
later_execute(process_mark_end,s,2300);
|
||||
|
||||
process_send_errstr(s,10,"开始打标");
|
||||
}
|
||||
|
||||
|
||||
@@ -403,7 +421,6 @@ static void process_mark_start(void *arg)
|
||||
{
|
||||
self_def *s=arg;
|
||||
SAFE_CHECK(s);
|
||||
|
||||
SET_OUTPUT(OUTPUT_MARK,1);
|
||||
DBG_LOG("mark start.");
|
||||
}
|
||||
|
Reference in New Issue
Block a user