BCD码与DEC码互转代码 直接上代码 uint8_t RTC_BCD2DEC(uint8_t bcd) { return (bcd-(bcd>>4)*6); } uint8_t RTC_DEC2BCD(uint8_t dec) { return (dec+(dec/10)*6); }