1、码间转换
static unsigned char bcd_decimal(unsigned char bcd) //BCD 到 十进制
{
return bcd-(bcd >> 4)*6;
}
static unsigned char decimal_bcd(unsigned char decimal) //十进制 到 BCD
{
return (unsigned char) (decimal+(decimal / 10)*6);
}
1、码间转换
static unsigned char bcd_decimal(unsigned char bcd) //BCD 到 十进制
{
return bcd-(bcd >> 4)*6;
}
static unsigned char decimal_bcd(unsigned char decimal) //十进制 到 BCD
{
return (unsigned char) (decimal+(decimal / 10)*6);
}