diff --git a/sys/fmt/fmt.c b/sys/fmt/fmt.c index 0c169e6211..bfc61836d4 100644 --- a/sys/fmt/fmt.c +++ b/sys/fmt/fmt.c @@ -290,6 +290,13 @@ void print_s32_dec(int32_t val) print(buf, len); } +void print_byte_hex(uint8_t byte) +{ + char buf[2]; + fmt_byte_hex(buf, byte); + print(buf, sizeof(buf)); +} + void print_u32_hex(uint32_t val) { char buf[8]; diff --git a/sys/include/fmt.h b/sys/include/fmt.h index e3144c824c..8d602c639d 100644 --- a/sys/include/fmt.h +++ b/sys/include/fmt.h @@ -245,6 +245,13 @@ void print_u32_dec(uint32_t val); */ void print_s32_dec(int32_t val); +/** + * @brief Print byte value as hex to stdout + * + * @param[in] byte Byte value to print + */ +void print_byte_hex(uint8_t byte); + /** * @brief Print uint32 value as hex to stdout *