BCD码和十进制的相互转换
static unsigned char bcd_decimal(unsigned char bcd)
{
return bcd-(bcd >> 4)*6;
}
static unsigned char decimal_bcd(unsigned char decimal)
{
return (unsigned char) (decimal+(decimal / 10)*6);
}
BCD码和十进制的相互转换
static unsigned char bcd_decimal(unsigned char bcd)
{
return bcd-(bcd >> 4)*6;
}
static unsigned char decimal_bcd(unsigned char decimal)
{
return (unsigned char) (decimal+(decimal / 10)*6);
}