Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.54 KB | None | 0 0
  1.     /*
  2.        Repeat reading the time until the number of seconds read
  3.        at the beginning and at the end of RTC access are the same
  4.     */
  5.     do {
  6.         reg = 0;
  7.         cd.sec = getbcd(p, reg);
  8.         cd.min = getbcd(p, reg + 2);
  9.         cd.hour = getbcd(p, reg + 4);
  10.         if (BattClockBase->clocktype == MSM6242B)
  11.             reg = 6;
  12.         else
  13.             reg = 7;
  14.         cd.mday = getbcd(p, reg);
  15.         cd.month = getbcd(p, reg + 2);
  16.         cd.year = getbcd(p, reg + 4) + 1900;
  17.     } while (cd.sec != getbcd(p, 0));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement