comp.lang.ada
 help / color / mirror / Atom feed
* Duration for GNAT on ARM
@ 2014-12-23 21:21 Simon Wright
  2014-12-23 22:42 ` Dmitry A. Kazakov
  0 siblings, 1 reply; 6+ messages in thread
From: Simon Wright @ 2014-12-23 21:21 UTC (permalink / raw)


You use -gnatS to get GNAT to output a representation of package
Standard.

If you do this with a native compiler, you get (typically)

   type Duration is delta 0.000000001
     range -((2 ** 63 - 1) * 0.000000001) ..
           +((2 ** 63 - 1) * 0.000000001);
   for Duration'Small use 0.000000001;

However, if I do this with both GNAT GPL 2014 and FSF GCC 4.9.1
cross-compiling to arm-eabi for the STM32F4 family (Cortex M4), I get

   type Duration is delta 0.020
     range -((2 ** 31 - 1) * 0.020) ..
           +((2 ** 31 - 1) * 0.020);
   for Duration'Small use 0.020;

I can understand the 32-bit vs 64-bit part - a misguided attempt at
efficiency, perhaps - but who gets to say that the clock runs at 50 Hz?
On the STM32's with STMicroelectronics' HAL, the tick is 1 kHz.


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

end of thread, other threads:[~2014-12-24  9:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-23 21:21 Duration for GNAT on ARM Simon Wright
2014-12-23 22:42 ` Dmitry A. Kazakov
2014-12-23 22:52   ` J-P. Rosen
2014-12-24  0:27     ` Simon Wright
2014-12-24  9:40       ` Simon Wright
2014-12-24  0:04   ` Simon Wright

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