Now we have a guard for printf, disable it in the build if it's not
selected.
Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
void panic(const char *fmt, ...)
{
+#if CONFIG_IS_ENABLED(PRINTF)
va_list args;
va_start(args, fmt);
vprintf(fmt, args);
va_end(args);
+#endif
panic_finish();
}
void (*putc)(struct printf_info *info, char ch);
};
-static void putc_normal(struct printf_info *info, char ch)
-{
- putc(ch);
-}
-
static void out(struct printf_info *info, char c)
{
*info->bf++ = c;
return 0;
}
+#if CONFIG_IS_ENABLED(PRINTF)
+static void putc_normal(struct printf_info *info, char ch)
+{
+ putc(ch);
+}
+
int vprintf(const char *fmt, va_list va)
{
struct printf_info info;
return ret;
}
+#endif
static void putc_outstr(struct printf_info *info, char ch)
{
return i;
}
+#if CONFIG_IS_ENABLED(PRINTF)
int printf(const char *fmt, ...)
{
va_list args;
puts(printbuffer);
return i;
}
-
+#endif
void __assert_fail(const char *assertion, const char *file, unsigned line,
const char *function)