diff options
Diffstat (limited to 'common/print.c')
-rw-r--r-- | common/print.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/common/print.c b/common/print.c index d8a899b407..08d211f206 100644 --- a/common/print.c +++ b/common/print.c @@ -113,7 +113,6 @@ void print_decs(int16_t data) } -static inline void print_hex4(uint8_t data) { sendchar(data + ((data < 10) ? '0' : 'A' - 10)); @@ -137,8 +136,14 @@ void print_hex32(uint32_t data) print_hex16(data); } +void print_bin4(uint8_t data) +{ + for (int i = 4; i >= 0; i--) { + sendchar((data & (1<<i)) ? '1' : '0'); + } +} -void print_bin(uint8_t data) +void print_bin8(uint8_t data) { for (int i = 7; i >= 0; i--) { sendchar((data & (1<<i)) ? '1' : '0'); |