修改检测后CAN总线自动上传基础延时为 addr*10+200
修改检测时注码,单独注码判定 添加cmd_printf 函数不会自动添加换行符
This commit is contained in:
@@ -88,6 +88,27 @@ int cmd_print(const char *fmt,...)
|
||||
return length;
|
||||
}
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><D4B6>ӻ<EFBFBD><D3BB><EFBFBD>
|
||||
int cmd_printf(const char *fmt,...)
|
||||
{
|
||||
self_def *s=&g_self;
|
||||
if(s->data==0) return 0;
|
||||
va_list args;
|
||||
size_t length=0;
|
||||
va_start(args, fmt);
|
||||
length += vsnprintf(&s->data[length], CMD_RETURN_BUFF_SIZE - length - 1, fmt, args);
|
||||
if (length > CMD_RETURN_BUFF_SIZE - 1)
|
||||
length = CMD_RETURN_BUFF_SIZE - 1;
|
||||
va_end(args);
|
||||
s->data[length]=0;
|
||||
array_def *arr=arr_creat();
|
||||
arr_appends(arr,s->data,length);
|
||||
emit cmd_reply_signal(s,0,arr_temp(arr));
|
||||
return length;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -37,6 +37,7 @@ typedef struct{
|
||||
|
||||
int cmd_print(const char *fmt,...);
|
||||
|
||||
int cmd_printf(const char *fmt,...);
|
||||
|
||||
|
||||
signal cmd_reply_signal(void *obj,uint8_t cmd,array_def *data);
|
||||
|
@@ -178,7 +178,7 @@ static void check_later(void *t)
|
||||
{
|
||||
s->submit_times=10;
|
||||
s->submit_running=1;
|
||||
s->submit_delay=elec_local_addr()*3;
|
||||
s->submit_delay=elec_local_addr()*10+200;
|
||||
later_execute(check_submit_later,s,s->submit_delay);
|
||||
}else{
|
||||
s->cmd=0;
|
||||
|
Reference in New Issue
Block a user