|
IntrOS
|
tasks (creation, control, delays) More...
Macros | |
| #define | STK_SIZE(size) |
| size of the task stack in stk_t units: the size in bytes (rounded up) with the guard area | |
| #define | OS_TSK_STACK(stk, ...) |
| define task stack | |
| #define | static_TSK_STACK(stk, ...) |
| static alias of OS_TSK_STACK() | |
| #define | OS_WRK(tsk, proc, size) |
| define and initialize complete work area for task object | |
| #define | static_WRK(tsk, proc, size) |
| static alias of OS_WRK() | |
| #define | OS_TSK(tsk, proc, ...) |
| define and initialize complete work area for task object with default stack size | |
| #define | static_TSK(tsk, proc, ...) |
| static alias of OS_TSK() | |
| #define | OS_WRK_DEF(tsk, size) |
| define and initialize complete work area for task object | |
| #define | static_WRK_DEF(tsk, size) |
| static alias of OS_WRK_DEF() | |
| #define | OS_TSK_DEF(tsk, ...) |
| define and initialize complete work area for task object with default stack size | |
| #define | static_TSK_DEF(tsk, ...) |
| static alias of OS_TSK_DEF() | |
| #define | OS_WRK_START(tsk, size) |
| define, initialize and start complete work area for task object | |
| #define | static_WRK_START(tsk, size) |
| static alias of OS_WRK_START() | |
| #define | OS_TSK_START(tsk, ...) |
| define, initialize and start complete work area for task object with default stack size | |
| #define | static_TSK_START(tsk, ...) |
| static alias of OS_TSK_START() | |
| #define | WRK_INIT(proc, size) |
| create and initialize complete work area for task object | |
| #define | WRK_CREATE(proc, size) |
| create and initialize complete work area for task object | |
| #define | WRK_NEW WRK_CREATE |
| alias of WRK_CREATE() | |
| #define | TSK_INIT(proc, ...) |
| create and initialize complete work area for task object with default stack size | |
| #define | TSK_CREATE(proc, ...) |
| create and initialize complete work area for task object with default stack size | |
| #define | TSK_NEW TSK_CREATE |
| alias of TSK_CREATE() | |
| #define | SELF ( System.cur ) |
| alias of tsk_this() | |
Functions | |
| tsk_t * | tsk_this (void) |
| return current task object | |
| tsk_t * | cur_task (void) |
| alias of tsk_this() | |
| void | wrk_init (tsk_t *tsk, fun_t *proc, stk_t *stack, size_t size) |
| initialize complete work area for task object | |
| void | tsk_init (tsk_t *tsk, fun_t *proc, stk_t *stack, size_t size) |
| initialize complete work area for task object and start the task, if proc != NULL | |
| void | tsk_start (tsk_t *tsk) |
| start previously defined/created/stopped task object | |
| void | tsk_startFrom (tsk_t *tsk, fun_t *proc) |
| start previously defined/created/stopped task object | |
| void | tsk_startWith (tsk_t *tsk, fun_a *proc, void *arg) |
| start previously defined/created/stopped task object | |
| void | tsk_stop (void) |
| stop execution of current task | |
| void | tsk_exit (void) |
| alias of tsk_stop() | |
| void | tsk_reset (tsk_t *tsk) |
| stop execution of given task | |
| void | tsk_kill (tsk_t *tsk) |
| alias of tsk_reset() | |
| void | tsk_yield (void) |
| yield system control to the next task | |
| void | tsk_pass (void) |
| alias of tsk_yield() | |
| void | tsk_flip (fun_t *proc) |
| restart current task with the new proc (task function) | |
| void | tsk_sleepFor (cnt_t delay) |
| delay execution of current task for given duration of time | |
| void | tsk_delay (cnt_t delay) |
| alias of tsk_sleepFor() | |
| void | tsk_sleepNext (cnt_t delay) |
| delay execution of current task for given duration of time | |
| void | tsk_sleepUntil (cnt_t time) |
| delay execution of current task until given timepoint | |
| void | tsk_sleep (void) |
| delay indefinitely execution of current task | |
| int | tsk_suspend (tsk_t *tsk) |
| delay indefinitely execution of given task | |
| int | tsk_resume (tsk_t *tsk) |
| resume execution of given suspended task | |
| size_t | tsk_stackSpace (void) |
| chack water mark of the stack of the current task | |
tasks (creation, control, delays)
| #define STK_SIZE | ( | size | ) |
size of the task stack in stk_t units: the size in bytes (rounded up) with the guard area
| #define OS_TSK_STACK | ( | stk, | |
| ... ) |
define task stack
| stk | name of the stack (passed to the init function) |
| ... | size: (optional) size of task stack (in bytes); default: OS_STACK_SIZE |
| #define static_TSK_STACK | ( | stk, | |
| ... ) |
static alias of OS_TSK_STACK()
| #define OS_WRK | ( | tsk, | |
| proc, | |||
| size ) |
define and initialize complete work area for task object
| tsk | name of a pointer to task object |
| proc | task proc (initial task function) doesn't have to be noreturn-type it will be executed into an infinite system-implemented loop |
| size | size of task private stack (in bytes) |
| #define static_WRK | ( | tsk, | |
| proc, | |||
| size ) |
| #define OS_TSK | ( | tsk, | |
| proc, | |||
| ... ) |
define and initialize complete work area for task object with default stack size
| tsk | name of a pointer to task object |
| proc | task proc (initial task function) doesn't have to be noreturn-type it will be executed into an infinite system-implemented loop |
| ... | size: (optional) size of task private stack (in bytes); default: OS_STACK_SIZE |
| #define static_TSK | ( | tsk, | |
| proc, | |||
| ... ) |
static alias of OS_TSK()
| #define OS_WRK_DEF | ( | tsk, | |
| size ) |
define and initialize complete work area for task object
task proc (function body) must be defined immediately below
| tsk | name of a pointer to task object |
| size | size of task private stack (in bytes) |
| #define static_WRK_DEF | ( | tsk, | |
| size ) |
static alias of OS_WRK_DEF()
| #define OS_TSK_DEF | ( | tsk, | |
| ... ) |
define and initialize complete work area for task object with default stack size
task proc (function body) must be defined immediately below
| tsk | name of a pointer to task object |
| ... | size: (optional) size of task private stack (in bytes); default: OS_STACK_SIZE |
| #define static_TSK_DEF | ( | tsk, | |
| ... ) |
static alias of OS_TSK_DEF()
| #define OS_WRK_START | ( | tsk, | |
| size ) |
define, initialize and start complete work area for task object
task proc (function body) must be defined immediately below
| tsk | name of a pointer to task object |
| size | size of task private stack (in bytes) |
| #define static_WRK_START | ( | tsk, | |
| size ) |
static alias of OS_WRK_START()
| #define OS_TSK_START | ( | tsk, | |
| ... ) |
define, initialize and start complete work area for task object with default stack size
task proc (function body) must be defined immediately below
| tsk | name of a pointer to task object |
| ... | size: (optional) size of task private stack (in bytes); default: OS_STACK_SIZE |
| #define static_TSK_START | ( | tsk, | |
| ... ) |
static alias of OS_TSK_START()
| #define WRK_INIT | ( | proc, | |
| size ) |
create and initialize complete work area for task object
| proc | task proc (initial task function) doesn't have to be noreturn-type it will be executed into an infinite system-implemented loop |
| size | size of task private stack (in bytes) |
| #define WRK_CREATE | ( | proc, | |
| size ) |
create and initialize complete work area for task object
| proc | task proc (initial task function) doesn't have to be noreturn-type it will be executed into an infinite system-implemented loop |
| size | size of task private stack (in bytes) |
| #define TSK_INIT | ( | proc, | |
| ... ) |
create and initialize complete work area for task object with default stack size
| proc | task proc (initial task function) doesn't have to be noreturn-type it will be executed into an infinite system-implemented loop |
| ... | size: (optional) size of task private stack (in bytes); default: OS_STACK_SIZE |
| #define TSK_CREATE | ( | proc, | |
| ... ) |
create and initialize complete work area for task object with default stack size
| proc | task proc (initial task function) doesn't have to be noreturn-type it will be executed into an infinite system-implemented loop |
| ... | size: (optional) size of task private stack (in bytes); default: OS_STACK_SIZE |
|
inline |
return current task object
| void wrk_init | ( | tsk_t * | tsk, |
| fun_t * | proc, | ||
| stk_t * | stack, | ||
| size_t | size ) |
initialize complete work area for task object
don't start the task
| tsk | pointer to task object |
| proc | task proc (initial task function) doesn't have to be noreturn-type it will be executed into an infinite system-implemented loop |
| stack | base of task's private stack storage |
| size | size of task private stack (in bytes) |
| void tsk_init | ( | tsk_t * | tsk, |
| fun_t * | proc, | ||
| stk_t * | stack, | ||
| size_t | size ) |
initialize complete work area for task object and start the task, if proc != NULL
| tsk | pointer to task object |
| proc | task proc (initial task function) doesn't have to be noreturn-type it will be executed into an infinite system-implemented loop |
| stack | base of task's private stack storage |
| size | size of task private stack (in bytes) |
| void tsk_start | ( | tsk_t * | tsk | ) |
start previously defined/created/stopped task object
| tsk | pointer to task object |
| void tsk_startFrom | ( | tsk_t * | tsk, |
| fun_t * | proc ) |
start previously defined/created/stopped task object
| tsk | pointer to task object |
| proc | task proc (initial task function) doesn't have to be noreturn-type it will be executed into an infinite system-implemented loop |
| void tsk_startWith | ( | tsk_t * | tsk, |
| fun_a * | proc, | ||
| void * | arg ) |
start previously defined/created/stopped task object
| tsk | pointer to task object |
| proc | task initial procedure (initial task function) |
| arg | task initial procedure argument (for internal use) |
| void tsk_stop | ( | void | ) |
stop execution of current task
all mutexes held by the task are released (waiting tasks get E_STOPPED)
| void tsk_reset | ( | tsk_t * | tsk | ) |
stop execution of given task
all mutexes held by the task are released (waiting tasks get E_STOPPED)
other objects held by the task (e.g. semaphores, read/write locks) are not released
| tsk | pointer to task object |
| void tsk_flip | ( | fun_t * | proc | ) |
restart current task with the new proc (task function)
all mutexes held by the task are released (waiting tasks get E_STOPPED)
| proc | new task proc (task function) |
| void tsk_sleepFor | ( | cnt_t | delay | ) |
delay execution of current task for given duration of time
| delay | duration of time (maximum number of ticks to delay execution of current task)
|
| void tsk_sleepNext | ( | cnt_t | delay | ) |
delay execution of current task for given duration of time
from the end of the previous countdown
| delay | duration of time (maximum number of ticks to delay execution of current task)
|
| void tsk_sleepUntil | ( | cnt_t | time | ) |
delay execution of current task until given timepoint
| time | timepoint value
|
|
inline |
delay indefinitely execution of current task
execution of the task can be resumed
| int tsk_suspend | ( | tsk_t * | tsk | ) |
| int tsk_resume | ( | tsk_t * | tsk | ) |
|
inline |
chack water mark of the stack of the current task
| 0 | DEBUG not defined or the current task is the main task (its stack size is unknown) |