TSK_sleep
2-506
C Interface
Syntax
TSK_sleep(nticks);
Parameters
Uns
nticks;
/* number of system clock ticks to sleep */
Return Value
Void
Description
TSK_sleep changes the current task’s mode from TSK_RUNNING to
TSK_BLOCKED, and delays its execution for nticks increments of the
system clock. The actual time delayed can be up to 1 system clock tick
less than timeout due to granularity in system timekeeping.
After the specified period of time has elapsed, the task reverts to the
TSK_READY mode and is scheduled for execution.
A task switch always occurs when calling TSK_sleep if nticks > 0.
Constraints and
Calling Context
❏
TSK_sleep cannot be called from a SWI or HWI, or within a
TSK_disable / TSK_enable block.
❏
TSK_sleep cannot be called from the program’s main() function.
❏
TSK_sleep should not be called from within an IDL function. Doing so
prevents analysis tools from gathering run-time information.
❏
nticks cannot be SYS_FOREVER.
TSK_sleep
Delay execution of the current task