30.12.2013 Views

T-Kernel Specification (1.B0.02)

T-Kernel Specification (1.B0.02)

T-Kernel Specification (1.B0.02)

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.

92 CHAPTER 4. T-KERNEL/OS FUNCTIONS<br />

tk wai flg<br />

Wait Event Flag<br />

[C Language Interface]<br />

ER ercd = tk_wai_flg ( ID flgid, UINT waiptn, UINT wfmode, UINT *p_flgptn, TMO tmout ) ;<br />

[Parameters]<br />

ID flgid Event flag ID<br />

UINT waiptn Wait bit pattern<br />

UINT wfmode Wait release condition<br />

TMO tmout Timeout designation<br />

[Return Parameters]<br />

ER ercd Error code<br />

UINT flgptn Event flag bit pattern<br />

[Error Codes]<br />

E OK<br />

E ID<br />

E NOEXS<br />

E PAR<br />

E OBJ<br />

E DLT<br />

E RLWAI<br />

E DISWAI<br />

E TMOUT<br />

E CTX<br />

Normal completion<br />

Invalid ID number (flgid is invalid or cannot be used)<br />

Object does not exist (the event flag designated in flgid does not exist)<br />

Parameter error (waiptn = 0, wfmode is invalid, or tmout ≤ (−2))<br />

Invalid object state (multiple tasks are waiting for an event flag with TA WSGL attribute)<br />

The object being waited for was deleted (the designated event flag was deleted while<br />

waiting)<br />

Wait state released (tk rel wai received in wait state)<br />

Wait released by wait disabled state<br />

Polling failed or timeout<br />

Context error (issued from task-independent portion or in dispatch disabled state)<br />

[Description]<br />

Waits for the event flag designated in flgid to be set, fulfilling the wait release condition designated in<br />

wfmode.<br />

If the event flag designated in flgid already meets the wait release condition set in wfmode, the waiting<br />

task continues executing without going to WAIT state.<br />

wfmode is designated as follows.<br />

wfmode := (TWF_ANDW || TWF_ORW) | [TWF_CLR || TWF_BITCLR]<br />

Copyright c○ 2002, 2003 by T-Engine Forum<br />

T-<strong>Kernel</strong> <strong>1.B0.02</strong>

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

Saved successfully!

Ooh no, something went wrong!