diff options
author | tmk <nobody@nowhere> | 2013-01-29 10:40:43 +0900 |
---|---|---|
committer | tmk <nobody@nowhere> | 2013-01-29 10:40:43 +0900 |
commit | ddb560052a8a336b5cec64ce08399c8299c9b4da (patch) | |
tree | 2fa3ea010b5942cbf21a4275805c66b5b82b9bff /common/print.c | |
parent | 1e3e41a2c9ed8b2f7d44be0aed5d96ed557fa13d (diff) |
Clean debug print in action.c.
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'); |