From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d1b37af34f7d1666,start X-Google-Attributes: gid103376,public From: Marin David Condic Subject: Connecting To Interrupts Using Protected Procedures Date: 1999/02/17 Message-ID: <36CB42FA.FDD195CF@pwfl.com>#1/1 X-Deja-AN: 445483169 Content-Transfer-Encoding: 7bit Sender: condicma@bogon.pwfl.com Content-Type: text/plain; charset=us-ascii Organization: Pratt & Whitney Mime-Version: 1.0 Reply-To: diespammer@pwfl.com Newsgroups: comp.lang.ada Date: 1999-02-17T00:00:00+00:00 List-Id: I'm looking at trying to convert an Ada83 method of handling interrupts into the Ada95 preferred technique and am a bit puzzled as to how to go about it. What we've been doing is connecting an entry in one task (or connecting a procedure) to an interrupt that goes off every milisecond. The task/procedure does some work and on every Nth cycle it initiates a slower cycle task by calling a parameterless entry or initiating an interrupt to which the entry is tied. (Not both at the same time - just two different ways we have done it.) Now Ada95 allows this as per ARM J.7.1 etc. but given that it is considered obsolete, I'd like to do it by the preferred method. So I've looked at connecting the 1ms interrupt to a protected procedure and this all looks pretty straightforward. The problem is getting this protected procedure to periodically kick off the slower cycle task. According to ARM 9.5.1(8..17) you can't call an entry from there without creating a bounded error. (Maybe it will run, but only if the system can't detect it and raise Program_Error.) So how is it that the protected procedure should communicate to the slower task to start cycling? You want the slower task to be blocked until its time cycle comes around again, so you would naturally think of some form of entry - but so far as I can see, I've got no way of legally doing that. I suppose one could poll a shared variable until the interrupt handler set the flag, but polling answers are just not practical in this arena. (Ideally, you would want to implement this with a clock and a delay statement, but the hardware doesn't support this at the moment.) Does anybody have a suggested method of doing this? Possibly with a code snippet or two to illustrate? Thanks in advance. MDC -- Marin David Condic Real Time & Embedded Systems, Propulsion Systems Analysis United Technologies, Pratt & Whitney, Large Military Engines M/S 731-95, P.O.B. 109600, West Palm Beach, FL, 33410-9600 Ph: 561.796.8997 Fx: 561.796.4669 ***To reply, remove "bogon" from the domain name.*** "Crime does not pay ... as well as politics." -- A. E. Newman