Skip to content
Snippets Groups Projects
Commit f03bfbef authored by Eemeli's avatar Eemeli
Browse files

fix RTC minute reading

parent b89b19ab
No related branches found
No related tags found
No related merge requests found
...@@ -254,7 +254,7 @@ impl RtcPorts { ...@@ -254,7 +254,7 @@ impl RtcPorts {
if reg_b & 0x04 == 0 { if reg_b & 0x04 == 0 {
let bcd_to_bin = |bcd: u8| -> u8 { (bcd & 0x0F) + bcd / 16 * 10 }; let bcd_to_bin = |bcd: u8| -> u8 { (bcd & 0x0F) + bcd / 16 * 10 };
last.sec = bcd_to_bin(last.sec); last.sec = bcd_to_bin(last.sec);
last.min = bcd_to_bin(last.sec); last.min = bcd_to_bin(last.min);
/* last.hour = bcd_to_bin(last.hour); */ /* last.hour = bcd_to_bin(last.hour); */
last.hour = (last.hour & 0x0F) + (((last.hour & 0x70) / 16 * 10) | (last.hour & 0x80)); last.hour = (last.hour & 0x0F) + (((last.hour & 0x70) / 16 * 10) | (last.hour & 0x80));
last.day = bcd_to_bin(last.day); last.day = bcd_to_bin(last.day);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment