comp.lang.ada
 help / color / mirror / Atom feed
From: Marin David Condic <condicma@bogon.pwfl.com>
Subject: Re: Connecting To Interrupts Using Protected Procedures
Date: 1999/02/18
Date: 1999-02-18T00:00:00+00:00	[thread overview]
Message-ID: <36CC396C.2DE13D4A@pwfl.com> (raw)
In-Reply-To: 7ahak3$95s$1@remarQ.com

Pat Rogers wrote:
> 
> 
> Since you asked for a snippet of code:
> 
<snip>
I also received help from David Brown wherein he posted the code
attached. Very similar answers so it seems this is a fairly common way
to go. I appreciate all the help on this. Now the only question we'll
have to answer is how efficient/inefficient the various features may
be...

MDC
===========================================================================

I think this is similar to what you want.  Feel free to post this.
I'm having problems with the configuration of my newsreader, and am
having trouble posting.

   ...

   Tick_Divider : constant := 9;

   protected Pclock is
      entry Wait;
      procedure Tick;
      pragma Attach_Handler (Tick, Ada.Interrupts.Names.SIGINT);
   private
      Counter : Natural := 0;
   end Pclock;

   protected body Pclock is
      entry Wait when Counter > Tick_Divider is
      begin
         Counter := 0;
      end Wait;

      procedure Tick is
      begin
         Counter := Counter + 1;
      end Tick;
   end Pclock;

   task Waiter is
   end Waiter;

   task body Waiter is
   begin
      loop
         Pclock.Wait;
         Ada.Text_IO.Put_Line ("Got slower ticks");
      end loop;
   end Waiter;

==========================================================================

-- 
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




  reply	other threads:[~1999-02-18  0:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-02-17  0:00 Connecting To Interrupts Using Protected Procedures Marin David Condic
1999-02-17  0:00 ` Pat Rogers
1999-02-18  0:00   ` Pat Rogers
1999-02-18  0:00     ` Marin David Condic [this message]
1999-02-18  0:00 ` robert_dewar
1999-02-18  0:00   ` Marin David Condic
1999-02-18  0:00     ` robert_dewar
1999-02-18  0:00 ` Matthew Heaney
replies disabled

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