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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,7bb6fcf19a817eb0 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news3.google.com!newsfeed2.dallas1.level3.net!news.level3.com!newsfeed-00.mathworks.com!oleane.net!oleane!hunter.axlog.fr!nobody From: Jean-Pierre Rosen Newsgroups: comp.lang.ada Subject: Re: tasking design for keylock Date: Fri, 03 Mar 2006 14:04:42 +0100 Organization: Adalog Message-ID: <7te9ud.fa6.ln@hunter.axlog.fr> References: <1141389368.420323.184550@v46g2000cwv.googlegroups.com> NNTP-Posting-Host: mailhost.axlog.fr Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: s1.news.oleane.net 1141394470 1611 195.25.228.57 (3 Mar 2006 14:01:10 GMT) X-Complaints-To: abuse@oleane.net NNTP-Posting-Date: Fri, 3 Mar 2006 14:01:10 +0000 (UTC) User-Agent: Thunderbird 1.5 (Windows/20051201) In-Reply-To: <1141389368.420323.184550@v46g2000cwv.googlegroups.com> Xref: g2news1.google.com comp.lang.ada:3255 Date: 2006-03-03T14:04:42+01:00 List-Id: Rolf a �crit : > The following problem arose when I was thinking about the design for a > minimal tasking runtime system. > > Many doors are locked by electronic keylocks where one has to type four > correct keys on a small keyboard (mostly 0 .. 9, *, #) before the lock > is opened. Now there are requirements > > - that the time between the key presses must not exceed 0.5 seconds, > - and that after the 4th correct key you must not type any key at all > for at least 0.5 seconds. > > How do you model the timing requirements using Ada tasking? (I can > attach the h/w interrupt from the key press to a protected procedure, > but I don't know how to proceed from there, i.e. how to cancel or serve > a timed entry call now) > > Why not call the Clock function every time a key is pressed? -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr