Keil RTX51 Manual page 34

Table of Contents

Advertisement

34
os_wait
Summary:
Description:
4
Return Value:
See Also:
Example:
#include <rtx51tny.h>
char os_wait (
unsigned char event_sel,
unsigned char ticks,
unsigned int dummy);
The os_wait function halts the current task and waits for one or
several events such as a time interval, a time-out, or a signal from
another task or interrupt. The event_sel argument specifies the
event or events to wait for and can be any combination of the fol-
lowing manifest constants:
Event constant
Description
K_IVL
Wait for a timer tick interval.
K_SIG
Wait for a signal.
K_TMO
Wait for a time
The above events can be logically ORed using the vertical bar
character ( | ). For example, K_TMO | K_SIG, specifies that the
task wait for a time-out or for a signal.
The ticks argument specifies the number of timer ticks to wait for
an interval event ( K_IVL ) or a time-out event ( K_TMO ).
The dummy argument is provided for compatibility with RTX51
and is not used in RTX51 Tiny.
When one of the specified events occurs, the task is enabled for
execution. Execution is restored and a manifest constant that iden-
tifies the event that restarted the task is returned by the os_wait
function. Possible return values are:
Return Value
Description
SIG_EVENT
A signal was received.
TMO_EVENT
-
A time
out has completed or an interval has expired.
NOT_OK
The value of the event_sel argument is invalid.
os_wait1, os_wait2
#include <rtx51tny.h>
RTX51 Tiny Function Library
/* events to wait for */
/* timer ticks to wait */
/* unused argument */
-
out.

Advertisement

Table of Contents
loading

Table of Contents