|
|
@@ -18,15 +18,6 @@ void set_log_level(int mod, int l){
|
|
|
level_data[index] = (level_data[index] & (~(LEVEL_MASK<<mod))) | ((l & LEVEL_MASK)<<mod);
|
|
|
}
|
|
|
|
|
|
-static int _lock(void){
|
|
|
- return 0;
|
|
|
-}
|
|
|
-
|
|
|
-static int _unlock(void){
|
|
|
- return 0;
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
static void log_out(char *fmt, va_list args){
|
|
|
vprintf(fmt, args);
|
|
|
if (fmt[strlen(fmt) - 1] != '\n'){
|
|
|
@@ -61,14 +52,11 @@ void log_error(int mod, char *fmt, ...){
|
|
|
}
|
|
|
}
|
|
|
//rewrite the fputc, so that the printf,vprintf can log the info the can
|
|
|
+#if LOG_UART==0
|
|
|
static char log_buffer[8];
|
|
|
static int log_index = 0;
|
|
|
int fputc(int c, FILE *fp){
|
|
|
can_id_t frame_id;
|
|
|
- if (_lock() == 1){
|
|
|
- return 1;
|
|
|
- }
|
|
|
-
|
|
|
frame_id.id=0;
|
|
|
frame_id.src = CAN_MY_ADDRESS;
|
|
|
frame_id.type = ptype_indicater;
|
|
|
@@ -87,7 +75,7 @@ int fputc(int c, FILE *fp){
|
|
|
}else{
|
|
|
log_buffer[log_index++] = c;
|
|
|
}
|
|
|
- _unlock();
|
|
|
return 1;
|
|
|
}
|
|
|
+#endif
|
|
|
|