Hiya,
My startup code was actually listed in the original EAB thread, you could have just copied that?
void startup() {
// Create the timer.
timerRequest = CreateTimer(UNIT_ECLOCK);
}
struct timerequest *CreateTimer(ULONG theUnit)
{
ULONG Error;
struct timerequest *TimeReq;
if (!(TimerPort=CreatePort(NULL,0))) {
return NULL;
}
if (!(TimeReq = (struct timerequest*)(CreateExtIO(TimerPort,sizeof(struct timerequest)))))
{
DeletePort(TimerPort);
return NULL;
}
Error = OpenDevice(TIMERNAME, theUnit, (struct IORequest*)(TimeReq), 0);
if (Error!=0)
{
DeleteExtIO((struct IORequest*)(TimeReq));
DeletePort(TimerPort);
return NULL;
}
TimerBase=(struct Library*)(TimeReq->tr_node.io_Device);
return(TimeReq);
}
I used the following declarations:
#include
// Amiga Timer.
struct Device *TimerBase;
struct timerequest *timerRequest;
struct timeval startTime;
ULONG timerUnit;
Seems to work ok for me using the 3.9 NDK
