修改检测后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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user