...
void OSTaskCreateHook (OS_TCB *p_tcb)
...
File |
...
...
Called from |
...
Code enabled by |
...
...
|
...
|
...
N/A |
...
OSTaskCreate()
after initializing the OS_TCB
fields and setting up the stack frame for the task, just before adding the task to the ready list. When OSTaskCreateHook()
is called, all of the OS_TCB
fields are assumed to be initialized.OSTaskCreateHook()
is part of the CPU port code and this function must not be called by the application code. OSTaskCreateHook()
is actually used by the µC/OS-III port developer. 1004577 Anchor
You can use this hook to initialize and store the contents of ?oating-point registers, MMU registers, or anything else that can be associated with a task. Typically, you would store this additional information in memory allocated by the application. Anchor
Arguments
...
p_tcb
Anchor
is a pointer to the TCB of the task being created. Note that the OS_TCB
has been validated by OSTaskCreate()
and is guaranteed to not be a NULL
pointer when OSTaskCreateHook()
is called.
...
Returned Value
...
None Anchor
Notes/Warnings
Anchor
Example
...
The code below calls an application-specific hook that the application programmer can define. The user can simply set the value of OS_AppTaskCreateHookPtr
to point to the desired hook function as shown in the example. OSTaskCreate()
calls OSTaskCreateHook()
which in turns calls App_OS_TaskCreateHook()
through OS_AppTaskCreateHookPtr
. As can be seen, when called, the application hook is passed the address of the OS_TCB
of the newly created task. Anchor
...
rowspan | 4 |
---|
...