vprintf: Avoid printf() to avoid FPU usage

This commit is contained in:
Sebastian Huber 2018-09-10 15:07:57 +02:00
parent f7d6bd2306
commit f56067e26c

View File

@ -48,8 +48,6 @@
#include <rtems/bsd/bsd.h> #include <rtems/bsd/bsd.h>
#undef printf
#define VPRINTF_LOCK() _Mutex_Acquire(&vprintf_mtx) #define VPRINTF_LOCK() _Mutex_Acquire(&vprintf_mtx)
#define VPRINTF_UNLOCK() _Mutex_Release(&vprintf_mtx) #define VPRINTF_UNLOCK() _Mutex_Release(&vprintf_mtx)
@ -86,7 +84,17 @@ default_vprintf_handler(int level, const char *fmt, va_list ap)
VPRINTF_LOCK(); VPRINTF_LOCK();
if (level != LOG_PRINTF) { if (level != LOG_PRINTF) {
printf("%s: ", log_priorities[LOG_PRI(level)]); const char *p;
p = log_priorities[LOG_PRI(level)];
while (*p != '\0') {
putchar(*p);
++p;
}
putchar(':');
putchar(' ');
} }
last = -1; last = -1;