修改can总线上传延时算法
This commit is contained in:
@@ -46,6 +46,7 @@ typedef struct{
|
||||
struct rt_mutex mutex;
|
||||
#endif
|
||||
uart_def *uart;
|
||||
int enable;
|
||||
}self_def;
|
||||
|
||||
static self_def g_data;
|
||||
@@ -89,12 +90,29 @@ void debug_log(const char *file,const char *fun,int line,int level,const char *f
|
||||
va_end(args);
|
||||
memcpy(&log_buf[length],"\r\n",2);
|
||||
length+=2;
|
||||
DBG_DEV_WRITE((const uint8_t *)log_buf,length);
|
||||
if(g_data.enable!=0){
|
||||
DBG_DEV_WRITE((const uint8_t *)log_buf,length);
|
||||
}
|
||||
#ifdef RT_THREAD
|
||||
rt_mutex_release(&g_data.mutex);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void debug_enable(int enable)
|
||||
{
|
||||
g_data.enable=enable;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
void debug_enable(int enable)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user