pico]OS
1.0.4
|
Typedefs | |
typedef POSTASK_t | NOSTASK_t |
typedef POSIDLEFUNC_t | NOSIDLEFUNC_t |
Functions | |
NANOEXT NOSTASK_t POSCALL | nosTaskCreate (POSTASKFUNC_t funcptr, void *funcarg, VAR_t priority, UINT_t stacksize, const char *name) |
NANOEXT void POSCALL | nosTaskYield (void) |
NANOEXT void POSCALL | nosTaskSleep (UINT_t ticks) |
NANOEXT void POSCALL | nosTaskExit (void) |
NANOEXT NOSTASK_t POSCALL | nosTaskGetCurrent (void) |
NANOEXT VAR_t POSCALL | nosTaskUnused (NOSTASK_t taskhandle) |
NANOEXT VAR_t POSCALL | nosTaskSetPriority (NOSTASK_t taskhandle, VAR_t priority) |
NANOEXT VAR_t POSCALL | nosTaskGetPriority (NOSTASK_t taskhandle) |
NANOEXT void POSCALL | nosTaskSchedLock (void) |
NANOEXT void POSCALL | nosTaskSchedUnlock (void) |
NANOEXT void *POSCALL | nosTaskGetUserspace (void) |
NANOEXT NOSIDLEFUNC_t POSCALL | nosInstallIdleTaskHook (NOSIDLEFUNC_t idlefunc) |
typedef POSIDLEFUNC_t NOSIDLEFUNC_t |
Idle task function pointer
NANOEXT NOSIDLEFUNC_t POSCALL nosInstallIdleTaskHook | ( | NOSIDLEFUNC_t | idlefunc | ) |
Task function. Install or remove an optional idle task hook function. The hook function is called every time the system is idle. It is possible to use this hook to implement your own idle task; in this case the function does not need to return to the system. You may insert a call to nosTaskYield into your idle task loop to get a better task performance.
idlefunc | function pointer to the new idle task handler. If this parameter is set to NULL, the idle task function hook is removed again. |
NANOEXT NOSTASK_t POSCALL nosTaskCreate | ( | POSTASKFUNC_t | funcptr, |
void * | funcarg, | ||
VAR_t | priority, | ||
UINT_t | stacksize, | ||
const char * | name | ||
) |
Generic task function. Creates a new task.
funcptr | pointer to the function that shall be executed by the new task. |
funcarg | optional argument passed to function funcptr. |
priority | task priority. Must be in the range 0 .. POSCFG_MAX_PRIO_LEVEL - 1. The higher the number, the higher the priority. |
stacksize | Size of the stack memory. If set to zero, a default stack size is assumed (see define NOSCFG_DEFAULT_STACKSIZE). |
name | Name of the new task to create. If the last character in the name is an asteriks (*), the operating system automatically assigns the task a unique name (the registry feature must be enabled for this automatism). This parameter can be NULL if the nano layer registry feature is not used and will not be used in future. |
NANOEXT void POSCALL nosTaskExit | ( | void | ) |
Task function. Terminate execution of a task.
NANOEXT NOSTASK_t POSCALL nosTaskGetCurrent | ( | void | ) |
Task function. Get the handle to the currently running task.
Task function. Get the priority of a task.
taskhandle | handle to the task. |
NANOEXT void* POSCALL nosTaskGetUserspace | ( | void | ) |
Task function. Returns a pointer to the user memory in the current task control block.
NANOEXT void POSCALL nosTaskSchedLock | ( | void | ) |
Task function. Locks the scheduler. When this function is called, no task switches will be done any more, until the counterpart function nosTaskSchedUnlock is called. This function is usefull for short critical sections that require exclusive access to variables. Note that interrupts still remain enabled.
NANOEXT void POSCALL nosTaskSchedUnlock | ( | void | ) |
Task function. Unlocks the scheduler. This function is called to leave a critical section. If a context switch request is pending, the context switch will happen directly after calling this function.
Task function. Change the priority of a task. Note that in a non-roundrobin scheduling environment every priority level can only exist once.
taskhandle | handle to the task. |
priority | new priority. Must be in the range 0 .. POSCFG_MAX_PRIO_LEVEL - 1. The higher the number, the higher the priority. |
NANOEXT void POSCALL nosTaskSleep | ( | UINT_t | ticks | ) |
Task function. Delay task execution for a couple of timer ticks.
Task function. Tests if a task is yet in use by the operating system. This function can be used to test if a task has been fully terminated (and the stack memory is no more in use).
taskhandle | handle to the task. |
NANOEXT void POSCALL nosTaskYield | ( | void | ) |
Task function. This function can be called to give off processing time so other tasks ready to run will be scheduled (= cooparative multitasking).