🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Timer device blues

#343
From: Rocky Lhotka
Date: Tue, 04 Jul 1989 19:05
55 lines
2088 bytes
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!!

#include "exec/types.h"
#include "exec/lists.h"
#include "exec/nodes.h"
#include "exec/ports.h"
#include "exec/io.h"
#include "exec/devices.h"
#include "devices/timer.h"

#define msgblock tr.tr_node.io_Message

struct timerequest tr;

main()
{
    int error;

    error = OpenDevice(TIMERNAME,UNIT_VBLANK,&tr,0);
    msgblock.mn_Node.ln_Type = NT_MESSAGE;
    msgblock.mn_Node.ln_Pri = 0;
    msgblock.mn_Node.ln_Name = NULL;
    msgblock.mn_ReplyPort = NULL;

    tr.tr_node.io_Command = TR_GETSYSTIME;
    DoIO(&tr);
    printf("\nSystem Time is:\n");
    printf("Seconds Microseconds\n");
    printf("%10ld %10ld\n",tr.tr_time.tv_secs,tr.tr_time.tv_micro);

    tr.tr_node.io_Command = TR_ADDREQUEST;
    tr.tr_time.tv_secs=10;
    tr.tr_time.tv_micro=0;
    DoIO(&tr);

    tr.tr_node.io_Command = TR_GETSYSTIME;
    DoIO(&tr);
    printf("\nSystem Time is:\n");
    printf("Seconds Microseconds\n");
    printf("%10ld %10ld\n",tr.tr_time.tv_secs,tr.tr_time.tv_micro);
    CloseDevice(&tr);
}


Rocky Lhotka
Glamdring, Sword of Mithrandir

UUCP: {amdahl!bungia, uunet!rosevax, chinet, killer}!orbit!pnet51!glamdrng
ARPA: crash!orbit!pnet51!glamdrng@nosc.mil
INET: glamdrng@pnet51.cts.com
Technical Details
Message-ID: <738@orbit.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!tut.cis.ohio-state.edu!uc!nic.MR.NET!umn-cs!bungia!orbit!pnet51!glamdrng

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!tut.cis.ohio-state.edu!uc!nic.MR.NET!umn-cs!bungia!orbit!pnet51!glamdrng
From: glamdrng@pnet51.cts.com (Rocky Lhotka)
Newsgroups: comp.sys.amiga.tech
Subject: Timer device blues
Message-ID: <738@orbit.UUCP>
Date: 4 Jul 89 19:05:10 GMT
Sender: root@orbit.UUCP
Organization: People-Net [pnet51], Minneapolis, MN.
Lines: 55