add helper function to extract bcd time values

This commit is contained in:
bunnie 2023-03-24 01:30:15 +08:00
parent e479de4e02
commit 4800cca65e

View file

@ -282,6 +282,6 @@ pub fn rtc_to_seconds(settings: &[u8]) -> Option<u64> {
Some(total_secs)
}
fn to_binary(bcd: u8) -> u8 {
pub fn to_binary(bcd: u8) -> u8 {
(bcd & 0xf) + ((bcd >> 4) * 10)
}