40 return byte + (6 * (
byte / 10));
53 return bcd - (6 * (bcd >> 4));
static uint8_t bcd_to_byte(uint8_t bcd)
Converts a binary coded decimal to a byte.
int bcd_buf_from_u32(uint32_t val, void *dst, size_t len)
Convert a decimal value into a BCD buffer.
static uint8_t bcd_from_byte(uint8_t byte)
Converts a byte to a binary coded decimal.