V0.06 气缸动作之后800ms直接请求注码,不读取到位信号
This commit is contained in:
@@ -189,6 +189,10 @@
|
||||
2023.11.16
|
||||
V0.05
|
||||
uid追溯改为10年,密码上报反序
|
||||
2023.11.21
|
||||
test_output 添加控制指定通道的功能
|
||||
2023.12.8
|
||||
V0.06 气缸动作之后800ms直接请求注码,不读取到位信号
|
||||
|
||||
|
||||
|
@@ -6,8 +6,8 @@
|
||||
|
||||
|
||||
|
||||
#define BUILD_DATE "2023-11-16 09:58:59"
|
||||
#define SOFT_VERSION "0.05"
|
||||
#define BUILD_DATE "2023-12-08 13:59:32"
|
||||
#define SOFT_VERSION "0.06"
|
||||
|
||||
|
||||
|
||||
|
@@ -7,7 +7,7 @@ from datetime import datetime, timedelta
|
||||
|
||||
|
||||
# 定义软件版本号
|
||||
SOFT_VERION = "0.05"
|
||||
SOFT_VERION = "0.06"
|
||||
|
||||
|
||||
|
||||
|
@@ -332,7 +332,9 @@ static void process_check_start(void *arg)
|
||||
|
||||
// 设置到位回调
|
||||
void process_pos(void *arg);
|
||||
input_set_callback_once(GET_POS_CHANNEL(s->step),1,process_pos,s);
|
||||
//input_set_callback_once(GET_POS_CHANNEL(s->step),1,process_pos,s);
|
||||
// 800ms后开始注码
|
||||
later_execute(process_pos,s,800);
|
||||
|
||||
// 选择当前使用的总线
|
||||
output_set(&s->bus_sel,GET_BUS_CHANNEL(s->step));
|
||||
@@ -648,22 +650,36 @@ static int test_output(list_def *argv)
|
||||
int power=0;
|
||||
if(list_length(argv)<2){
|
||||
cmd_print("param num too less.");
|
||||
cmd_print("param: on/off.");
|
||||
cmd_print("param0: on/off.");
|
||||
cmd_print("param1: 1,2,3,4,5,6,7,8,9,10.");
|
||||
return -1;
|
||||
}
|
||||
list_def *channels=0;
|
||||
if(list_length(argv)<3){
|
||||
channels=list_temp(list_creat_int());
|
||||
for(int i=0;i<10;i++){
|
||||
list_append_int(channels,i);
|
||||
}
|
||||
}else{
|
||||
channels=(str_atod_list(list_get_str(argv,2),','));
|
||||
}
|
||||
cmd_print("channels:%s",str_temp(list_string(channels)));
|
||||
power=(strcmp(list_get_str(argv,1),"on")==0)?1:0;
|
||||
// 这里默认驱动已经打开
|
||||
for(int i=0;i<OUTPUT_CHANNEL_NUM;i++)
|
||||
for(int i=0;i<list_length(channels);i++)
|
||||
{
|
||||
gpioout_name[7]='0'+i;
|
||||
int index=list_get_int(channels,i);
|
||||
if(index>=0&&index<OUTPUT_CHANNEL_NUM){
|
||||
gpioout_name[7]='0'+index;
|
||||
out=dev_get(gpioout_name);
|
||||
if(out){
|
||||
out->set(out,power);
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
commend_export(test_output,test_output,"ctrl out state,param: on/off")
|
||||
commend_export(test_output,test_output,"ctrl out state,param: on/off [channels]")
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user