comp.lang.ada
 help / color / mirror / Atom feed
From: Brian Drummond <brian@shapes.demon.co.uk>
Subject: Re: Q: setting an address with pure?
Date: Sat, 11 Jul 2015 10:35:15 +0000 (UTC)
Date: 2015-07-11T10:35:15+00:00	[thread overview]
Message-ID: <mnqrh2$mdm$1@dont-email.me> (raw)
In-Reply-To: lyy4iokzci.fsf@pushface.org

On Fri, 10 Jul 2015 12:48:29 +0100, Simon Wright wrote:

> I need to specify the address at which a hardware object appears.
> 
> This works:
> 
>    PIOA : PIO
>      with
>        Import,
>        Convention => Ada,
>        Address => System.Storage_Elements.To_Address (16#400E0E00#);
> 
> but means that I can't declare the package Pure (or even Preelaborate).
> 
> Is anyone aware of any GNAT feature that would allow such a package to
> be Pure? There are similar things in their package Standard, for example
> Standard'Address_Size.
> 
> I tried
> 
>    PIOG : PIO with Import, Convention => Ada;
>    for PIOG use at 16#400E1800#;
> 
> but, besides warning me that 'use at' is obsolescent, GNAT still expects
> System.Address not universal integer.

Does the following work for you? It seems to work in the MSP430 Ada 
compiler (based on gcc4.7.2) ... has anything changed in gcc5.1 to make 
this illegal?

-- Brian

with Interfaces;               use Interfaces;    
--   make unsigned_n visible 

package MSP.adc10 is
 
   pragma Preelaborate;
 
 
   adc10dtc0              : unsigned_8;     --  ADC10 Data Transfer 
Control 0 
   Pragma Volatile(adc10dtc0);
   For adc10dtc0'Address use   16#48#;
...
end MSP.adc10;


  parent reply	other threads:[~2015-07-11 10:35 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-10 11:48 Q: setting an address with pure? Simon Wright
2015-07-10 12:03 ` G.B.
2015-07-10 14:38   ` Simon Wright
2015-07-10 22:37 ` Randy Brukardt
2015-07-11  7:47   ` Simon Wright
2015-07-13 19:10     ` Randy Brukardt
2015-07-14  9:36       ` Mark Lorenzen
2015-07-13 23:41   ` RasikaSrinivasan
2015-07-14  7:38     ` Simon Wright
2015-07-14  7:42       ` Simon Wright
2015-07-11 10:35 ` Brian Drummond [this message]
2015-07-11 13:30   ` Q: " Simon Wright
2015-07-11 14:03     ` AdaMagica
2015-07-11 14:27       ` Simon Wright
2015-07-13 18:53         ` Randy Brukardt
2015-07-13 19:50           ` Simon Wright
2015-07-14 12:24     ` Brian Drummond
2015-07-15 15:50       ` rrr.eee.27
2015-07-15 18:45         ` Simon Wright
2015-07-16  9:21         ` Brian Drummond
2015-07-16 18:54           ` Simon Wright
2015-07-16 19:14           ` Randy Brukardt
replies disabled

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