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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f8311a3a7edd715 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2000-12-13 00:02:46 PST From: Brian Orpin Newsgroups: comp.lang.ada Subject: Re: Using "delay until" in real-time Date: Wed, 13 Dec 2000 08:02:42 +0000 Reply-To: abuse@borpin.co.uk (Brian Orpin This is valid) Message-ID: References: <915jl7$jt5$1@nnrp1.deja.com> <9168vi$7mp$1@nnrp1.deja.com> X-Newsreader: Forte Agent 1.8/32.548 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: esk2461.ct.edinbr.gecm.com X-Trace: 13 Dec 2000 07:57:20 GMT, esk2461.ct.edinbr.gecm.com Path: supernews.google.com!sn-xit-02!supernews.com!216.227.56.88.MISMATCH!telocity-west!TELOCITY!fr.clara.net!heighliner.fr.clara.net!grolier!btnet-peer0!btnet-feed5!btnet!newreader.ukcore.bt.net!pull.gecm.com!esk2461.ct.edinbr.gecm.com Xref: supernews.google.com comp.lang.ada:3048 Date: 2000-12-13T08:02:42+00:00 List-Id: On Tue, 12 Dec 2000 22:31:14 GMT, Ted Dennison wrote: >I did simplify things a bit for my question. We are actually using 4 >minor cycles in our 60Hz major cycle. Under the scheme we use here >things can only run once a major cycle, so the fastest with the current >settings would be 60Hz. However, we can adjust the minor cycle used in >order to prevent jitter in those tasks that are expecially sensitive to >it (eg: Controls and the Visual system). So our executive is *actually* >running at 240Hz (but of course this doesn't affect the math problem. >1/240th still a repeating decimal). Counter : Natural := 0 Freq1 : constant := 4; Freq2 : constant := 2; Min_Freq : constant := Freq1; begin Counter := (Counter mod Min_Freq) +1; -- do it every other cycle. if Counter mod Freq2 = 0 then do Task1; end if; -- do it every 4 cycles if Counter mod Freq1 = 0 then do Task2; end if; -- do it every 4 cycles but on a different cycle to task2 if Counter + 1 mod Freq1 = 0 then do Task3; end if; end; -- Brian Orpin BAE SYSTEMS, Edinburgh "If you really know C++, there isn't much you can't do with it, though it may not always be what you intended!" Tucker Taft 1998