tk_can_wup

Cancel Wakeup Task

[C Language Interface]

INT wupcnt = tk_can_wup ( ID tskid ) ;

[Parameters]

ID tskid Task ID

[Return Parameters]

INT wupcnt Number of queued wakeup requests

or Error Code

[Error Codes]

E_OK Normal completion

E_ID Invalid ID number (tskid is invalid or cannot be used)

E_NOEXS Object does not exist (the task specified in tskid does not exist)

E_OBJ Invalid object state (called for a task in DORMANT state)

[Description]

Passes in the return parameter the wakeup request queuing count (wupcnt) for the task specified in tskid, at the same time canceling all wakeup requests. That is, this system call clears the wakeup request queuing count (wupcnt) to 0 for the specified task.

The invoking task can be specified by setting tskid = TSK_SELF = 0. Note, however, that when a system call is issued from a task-independent portion and tskid = TSK_SELF = 0 is specified, error code E_ID is returned.

[Additional Notes]

When processing is performed that involves cyclic wakeup of a task, this system call is used to determine whether the processing was completed within the allotted time. Before processing of a prior wakeup request is completed and tk_slp_tsk is called, the task monitoring this calls tk_can_wup. If wupcnt in the return parameter is 1 or above, this means the previous wakeup request was not processed within the allotted time. A processing delay or other measure can then be taken accordingly.

Comments