File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -496,21 +496,18 @@ int uartGetDebug()
496496 return s_uart_debug_nr ;
497497}
498498
499- int log_printf (const char * format , ... )
499+ int log_printfv (const char * format , va_list arg )
500500{
501501 static char loc_buf [64 ];
502502 char * temp = loc_buf ;
503503 int len ;
504- va_list arg ;
505504 va_list copy ;
506- va_start (arg , format );
507505 va_copy (copy , arg );
508506 len = vsnprintf (NULL , 0 , format , copy );
509507 va_end (copy );
510508 if (len >= sizeof (loc_buf )){
511509 temp = (char * )malloc (len + 1 );
512510 if (temp == NULL ) {
513- va_end (arg );
514511 return 0 ;
515512 }
516513 }
@@ -528,13 +525,22 @@ int log_printf(const char *format, ...)
528525 xSemaphoreGive (_uart_bus_array [s_uart_debug_nr ].lock );
529526 }
530527#endif
531- va_end (arg );
532528 if (len >= sizeof (loc_buf )){
533529 free (temp );
534530 }
535531 return len ;
536532}
537533
534+ int log_printf (const char * format , ...)
535+ {
536+ int len ;
537+ va_list arg ;
538+ va_start (arg , format );
539+ len = log_printfv (format , arg );
540+ va_end (arg );
541+ return len ;
542+ }
543+
538544
539545static void log_print_buf_line (const uint8_t * b , size_t len , size_t total_len ){
540546 for (size_t i = 0 ; i < len ; i ++ ){
You can’t perform that action at this time.
0 commit comments