comp.lang.ada
 help / color / mirror / Atom feed
* Time_Span and Hardware resolutions
@ 2002-12-09 15:05 Sebastian
  2002-12-09 20:03 ` tmoran
  0 siblings, 1 reply; 2+ messages in thread
From: Sebastian @ 2002-12-09 15:05 UTC (permalink / raw)


Hi,

I have a problem that I don't really know how to solve.

I have a Ada.Real_Time.Time_Span parameter as an in parameter to a
procedure.
Now I would like to convert the value of that parameter to match the
resolution that my hardware requires.

For example:

If I get 37 milliseconds as a parameter I must convert the value of that to
be in steps of 100 us (microseconds). My hardware register has a resolution
of 100 us per LSB....

How shall I do that? I havent found any good examples that shows how
Time_Span works....

Happy for any suggestions...

/S





^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Time_Span and Hardware resolutions
  2002-12-09 15:05 Time_Span and Hardware resolutions Sebastian
@ 2002-12-09 20:03 ` tmoran
  0 siblings, 0 replies; 2+ messages in thread
From: tmoran @ 2002-12-09 20:03 UTC (permalink / raw)


> I have a Ada.Real_Time.Time_Span parameter as an in parameter to a
> procedure.
>...
> If I get 37 milliseconds as a parameter I must convert the value of that to
> be in steps of 100 us (microseconds).
How about:
  function Hardware_Ticks(T : in Ada.Real_Time.Time_Span) return Integer is
  begin
    return T/Ada.Real_Time.Microseconds(100);
  end Hardware_Ticks;
or the obvious changes to round up instead of truncate.



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-12-09 20:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-09 15:05 Time_Span and Hardware resolutions Sebastian
2002-12-09 20:03 ` tmoran

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