From ca5d3c2e0488b1888299ed7eb81c4dc16b7ac8c6 Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Sat, 11 May 2024 17:51:01 +0200 Subject: [PATCH 2/4] RIOT integration Use stdio_write() from stdio_base.h for output --- printf.c | 8 ++++++++ printf.h | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/printf.c b/printf.c index e6e18fa..d560d2b 100644 --- a/printf.c +++ b/printf.c @@ -34,6 +34,7 @@ #include #include "printf.h" +#include "stdio_base.h" // define this globally (e.g. gcc -DPRINTF_INCLUDE_CONFIG_H ...) to include the @@ -912,3 +913,10 @@ int fctprintf(void (*out)(char character, void* arg), void* arg, const char* for va_end(va); return ret; } + + +/* RIOT integration: Use stdio_write for output */ +static void _putchar(char character) +{ + stdio_write(&character, sizeof(character)); +} diff --git a/printf.h b/printf.h index 6075bc2..154930a 100644 --- a/printf.h +++ b/printf.h @@ -46,7 +46,7 @@ extern "C" { * This function is declared here only. You have to write your custom implementation somewhere * \param character Character to output */ -void _putchar(char character); +static void _putchar(char character); /** -- 2.43.0