comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Any leap year issues caused by Ada yesterday?
Date: Tue, 6 Mar 2012 20:18:33 +0100
Date: 2012-03-06T20:18:33+01:00	[thread overview]
Message-ID: <f7swwaoskj5m$.1aqwzadr8kaul$.dlg@40tude.net> (raw)
In-Reply-To: m2wr6xhaqf.fsf@pushface.org

On Tue, 06 Mar 2012 17:59:04 +0000, Simon Wright wrote:

> The timebase ran off the same crystal as the decrementer, so all were
> internally sync'd. Internally, our synchronised time was
> (Ada.Calendar.Clock (at last clock interrupt, of course) + high-res time
> since last clock interrupt).

You could improve that a bit by putting Ada.Calendar.Clock into a loop.
When it returns a different value, you exit the loop and take that value
for the time base.

If the quartz is same you need not to synchronize it anymore. Since the
multiplier is known you simply add the RTC minus its value at the base
multiplied by the factor and converted to Duration (or Time_Span) to the
base and use that instead of the original Ada's Clock.

Did you check the kernel settings? It has a variable that sets the time
source to the RTC. This might work on your PPC's BSP. The effect is that
the system clock is changed each time when queried rather than upon timer
interrupts.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



  reply	other threads:[~2012-03-06 19:18 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-01 13:06 Any leap year issues caused by Ada yesterday? Georg Bauhaus
2012-03-05 11:07 ` tonyg
2012-03-05 15:59   ` Shark8
2012-03-05 18:03     ` Dmitry A. Kazakov
2012-03-05 18:30       ` Simon Wright
2012-03-05 20:17         ` Dmitry A. Kazakov
2012-03-05 20:56           ` Simon Wright
2012-03-06  8:47             ` Dmitry A. Kazakov
2012-03-06  9:20               ` Simon Wright
2012-03-06 10:07                 ` Dmitry A. Kazakov
2012-03-06 10:51                   ` Georg Bauhaus
2012-03-06 11:16                     ` Dmitry A. Kazakov
2012-03-06 16:46                   ` Simon Wright
2012-03-06 17:37                     ` Dmitry A. Kazakov
2012-03-06 17:59                       ` Simon Wright
2012-03-06 19:18                         ` Dmitry A. Kazakov [this message]
2012-03-06 20:22                           ` Simon Wright
2012-03-06 19:08                       ` Shark8
2012-03-06 19:40                         ` Dmitry A. Kazakov
2012-03-06 21:00                       ` tmoran
2012-03-06 21:37                         ` Simon Wright
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox