tk_can_wup
Cancel Wakeup Task
See Also
INT wupcnt = tk_can_wup ( ID tskid ) ;
ID tskid Task ID
INT wupcnt Number of queued wakeup requests
or Error Code
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)
Returns the wakeup request queuing count (wupcnt) for the task specified in tskid and also cancels all wakeup requests at the same time. 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.
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 more, it means that the previous wakeup request was not processed within the allotted time. A processing delay or other measure can then be taken accordingly.

Comments
Click here to Post a Comment