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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,7bb6fcf19a817eb0,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!v46g2000cwv.googlegroups.com!not-for-mail From: "Rolf" Newsgroups: comp.lang.ada Subject: tasking design for keylock Date: 3 Mar 2006 04:36:08 -0800 Organization: http://groups.google.com Message-ID: <1141389368.420323.184550@v46g2000cwv.googlegroups.com> NNTP-Posting-Host: 194.97.67.1 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1141389373 1986 127.0.0.1 (3 Mar 2006 12:36:13 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 3 Mar 2006 12:36:13 +0000 (UTC) User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: v46g2000cwv.googlegroups.com; posting-host=194.97.67.1; posting-account=X6JcNAwAAACCYFUClJvh1OjD0lgttvkm Xref: g2news1.google.com comp.lang.ada:3254 Date: 2006-03-03T04:36:08-08:00 List-Id: 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) Rolf P.S. I made a small state diagram expressing the requirements but don't know where to upload it.