> > > The time obtained from RTC by rtc7800 makes random jumps.
> I guess the RTC registers are changing during the time the six
> registers are being read. According to the RTC datasheet, the clock
> register values can be 'frozen' by writing to bit 7 of control
> Register B. The code currently does this when setting the RTC, but
> not reading from it.
>
> Can you try adding the following patch (untested!):
>
> --- rtc7800.c 2008-03-11 11:17:48.000000000 -0400
> +++ rtc7800_test.c 2008-03-11 11:16:55.000000000 -0400
> @@ -95,6 +95,7 @@
> struct timeval tv;
> int h,pm;
>
> + wRTC(0xB,rRTC(0xB) | 0x80); // disable update
> t.tm_sec = frombcd(rRTC(0x0));
> t.tm_min = frombcd(rRTC(0x2));
> h = rRTC(0x4) & 0x7F;
> @@ -103,6 +104,7 @@
> t.tm_mon = frombcd(rRTC(0x8)) - 1;
> t.tm_year = frombcd(rRTC(0x9)) + 100;
> t.tm_isdst = -1;
> + wRTC(0xB,rRTC(0xB) & ~0x80); // re-enable update
>
> now = mktime(&t);
> tv.tv_sec = now;
>
>
>
> Regards, ............. Charlie
>
Hi,
so after 13+ hours there is no time discontinuity with the patched
code. It seems to fix the problem. Thanks a lot!
Jiri
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|