diff options
Diffstat (limited to 'src/console')
-rw-r--r-- | src/console/vtxprintf.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/console/vtxprintf.c b/src/console/vtxprintf.c index c57f38c033..502d53e818 100644 --- a/src/console/vtxprintf.c +++ b/src/console/vtxprintf.c @@ -129,7 +129,7 @@ int vtxprintf(void (*tx_byte)(unsigned char byte), const char *fmt, va_list args int field_width; /* width of output field */ int precision; /* min. # of digits for integers; max number of chars for from string */ - int qualifier; /* 'h', 'l', or 'L' for integer fields */ + int qualifier; /* 'h', 'H', 'l', or 'L' for integer fields */ int count; @@ -194,6 +194,10 @@ repeat: qualifier = 'L'; ++fmt; } + if (*fmt == 'h') { + qualifier = 'H'; + ++fmt; + } } /* default base */ @@ -287,6 +291,10 @@ repeat: num = (unsigned short) va_arg(args, int); if (flags & SIGN) num = (short) num; + } else if (qualifier == 'H') { + num = (unsigned char) va_arg(args, int); + if (flags & SIGN) + num = (signed char) num; } else if (flags & SIGN) { num = va_arg(args, int); } else { |