06.08.2013 Views

pSOSystem System Calls - Read

pSOSystem System Calls - Read

pSOSystem System Calls - Read

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

tm_evafter pSOS+ <strong>System</strong> <strong>Calls</strong><br />

tm_evafter Sends events to the calling task after a specified interval.<br />

#include <br />

unsigned long tm_evafter(<br />

unsigned long ticks, /* delay */<br />

unsigned long events, /* event list */<br />

unsigned long *tmid /* timer identifier */<br />

)<br />

Description<br />

Arguments<br />

Return Value<br />

This system call enables the calling task to arm a timer so that it expires after the<br />

specified interval, at which time the pSOS+ kernel internally calls ev_send() to<br />

send the designated events to this task. Unlike tm_wkafter(), tm_evafter()<br />

does not block the caller. A task can use multiple tm_evafter() calls to arm two<br />

or more concurrent timers.<br />

The timer interval is specified in system clock ticks. For example, if the system clock<br />

frequency is 60 ticks per second and the caller requires a timer to interrupt in 20<br />

seconds, the input specification should be 60x20 (ticks=1200). A timer interval of n<br />

ticks causes the events to be sent on the nth next tick. Because tm_evafter() can<br />

happen anywhere between two ticks, the actual interval is between n-1 and n ticks.<br />

ticks Specifies the timer interval.<br />

events Specifies the events to deliver upon expiration of the timer interval.<br />

The events are encoded into a long word with bits 31-16 reserved for<br />

system use and bits 15 - 0 available for application use.<br />

tmid Points to the variable where tm_evafter() stores a timer identifier,<br />

which can be used if the armed timer must be cancelled.<br />

This system call returns 0 on success, or an error code on failure.<br />

1-166 <strong>pSO<strong>System</strong></strong> <strong>System</strong> <strong>Calls</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!