From 67d52f67df17acd7d710049c065fce83afe7b49e Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Tue, 15 Oct 2019 13:33:06 +0100 Subject: Add binary support to tinyprintf (#7024) --- tmk_core/common/chibios/printf.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tmk_core') diff --git a/tmk_core/common/chibios/printf.c b/tmk_core/common/chibios/printf.c index dbd059448c..dcf33f35f8 100644 --- a/tmk_core/common/chibios/printf.c +++ b/tmk_core/common/chibios/printf.c @@ -186,6 +186,15 @@ void tfp_format(void* putp, putcf putf, char* fmt, va_list va) { case 's': putchw(putp, putf, w, 0, va_arg(va, char*)); break; + case 'b': +#ifdef PRINTF_LONG_SUPPORT + if (lng) + uli2a(va_arg(va, unsigned long int), 2, 0, bf); + else +#endif + ui2a(va_arg(va, unsigned int), 2, 0, bf); + putchw(putp, putf, w, lz, bf); + break; case '%': putf(putp, ch); default: -- cgit v1.2.3