summaryrefslogtreecommitdiff
path: root/tmk_core/common/chibios
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2019-10-15 13:33:06 +0100
committerFlorian Didron <fdidron@users.noreply.github.com>2019-11-04 16:58:54 +0900
commit5f57fa478d1a854ae165ed5f15d5889b5c66ac75 (patch)
treed7cac504e7b582bc03f1ebf651de1d658b998d4b /tmk_core/common/chibios
parentab799d56289000806ea9772083d80cfbab77ea0a (diff)
Add binary support to tinyprintf (#7024)
Diffstat (limited to 'tmk_core/common/chibios')
-rw-r--r--tmk_core/common/chibios/printf.c9
1 files changed, 9 insertions, 0 deletions
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: