添加tran命令透传小板命令

添加slave_info命令测试小板通信状态
  添加cfginfo命令显示配置文件信息
  按键处于按下状态才响应检测命令
This commit is contained in:
ranchuan
2023-12-29 18:09:10 +08:00
parent 92f3ebbe33
commit 66ecf9c411
12 changed files with 212 additions and 50 deletions

View File

@@ -8,6 +8,7 @@
#include "QDebug"
#include "elec/elec_judge.h"
#include "QDateTime"
#include "prot_cmd/cmd_m4.h"
typedef struct
{
@@ -96,19 +97,24 @@ int selfdev_check::dolater(int cmd, myarray data)
}
}
};
myarray moter_cmd=moter_ctrl("down");
if(moter_cmd.size()==0){
busy=0;
qWarning("moter failed.");
}else{
m4->set_irq_fun(moter_down_cb_fun,"moter down");
emit send_to_m4_signal(moter_cmd);
}
slave_acked.clear();
for(int i=0;i<cfg->slave_num;i++){
slave_acked.append(myarray());
}
slave_acked_num=0;
myarray moter_cmd=moter_ctrl("down");
if(moter_cmd.size()==0){
busy=0;
qWarning("moter failed.");
return 1;
}
if(cmd_m4_key_pressed()!=0){
m4->set_irq_fun(moter_down_cb_fun,"moter down");
emit send_to_m4_signal(moter_cmd);
}else{
qWarning("key not pressed,check will not start.");
return 2;
}
return 0;
}