🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #417

Re: Timer device blues

#417
From: Adam Levin - CATS
Date: Fri, 07 Jul 1989 16:25
27 lines
1696 bytes
In article <738@orbit.UUCP> glamdrng@pnet51.cts.com (Rocky Lhotka) writes:
>I am having some problems getting the timer device to work...  Specifically, I
>can do a GETSYSTIME with no problem, but an ADDREQUEST always locks up the
>computer...  I have tried several examples from several books and none of them
>work either (are they all THAT bad???).  Here is my latest attempt, where the
>GETSYSTIME works, but it locks up on the second DoIO when I try to perform an
>ADDREQUEST.  Any help would be VERY VERY appreciated!!
>

(code deleted)

Your example program neglected to create a reply port.
Read the large listing in the RKM just following the one you
based your code on.  Your program will get control back after
the TR_ADDREQUEST is satisfied once there is a reply port available.

In the very simplest case, change the line that reads:
	msgblock.mn_ReplyPort = NULL;
to:
	msgblock.mn_ReplyPort = (struct ReplyPort *)CreatePort(0,0);

It is good programming practice to check that the port was actually created.

-- 
     Adam Keith Levin  --  CATS   Commodore-Amiga Technical Support
     1200 Wilson Drive / West Chester, PA  19380     (215) 431-9180
     BIX: aklevin        UUCP: ...{amiga|rutgers|uunet}!cbmvax!adam
Technical Details
Message-ID: <7238@cbmvax.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!gatech!purdue!mailrus!ulowell!cbmvax!adam
References: <738@orbit.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!gatech!purdue!mailrus!ulowell!cbmvax!adam
From: adam@cbmvax.UUCP (Adam Levin - CATS)
Newsgroups: comp.sys.amiga.tech
Subject: Re: Timer device blues
Summary: Need a reply port.
Message-ID: <7238@cbmvax.UUCP>
Date: 7 Jul 89 16:25:13 GMT
References: <738@orbit.UUCP>
Reply-To: adam@cbmvax.UUCP (Adam Levin - CATS)
Organization: Commodore Technology, West Chester, PA
Lines: 27