diff options
Diffstat (limited to 'src/target/firmware/lib/printf.c')
-rw-r--r-- | src/target/firmware/lib/printf.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/target/firmware/lib/printf.c b/src/target/firmware/lib/printf.c new file mode 100644 index 00000000..a4fc6876 --- /dev/null +++ b/src/target/firmware/lib/printf.c @@ -0,0 +1,19 @@ + +#include <stdio.h> +#include <stdarg.h> + +static char printf_buffer[1024]; + +int printf(const char *fmt, ...) +{ + va_list args; + int r; + + va_start(args, fmt); + r = vsnprintf(printf_buffer, sizeof(printf_buffer), fmt, args); + va_end(args); + + puts(printf_buffer); + + return r; +} |