OSStatTaskCPUUsageInit()
void OSStatTaskCPUUsageInit (OS_ERR *p_err)
File |
Called from |
Code enabled by |
os_stat.c |
Startup code only |
OS_CFG_TASK_STAT_EN |
OSStatTaskCPUUsageInit() determines the maximum value that a 32-bit counter can reach when no other task is executing. This function must be called when only one task is created in the application and when multitasking has started. This function must be called from the first and only task created by the application.
Arguments
p_err
is a pointer to a variable used to hold an error code:
Returned Value
None
Notes/Warnings
None
Example
void FirstAndOnlyTask (void *p_arg) { OS_ERR err; : : #if OS_CFG_TASK_STAT_EN > 0 OSStatTaskCPUUsageInit(&err); /* Compute CPU capacity with no task running */ #endif : OSTaskCreate(_); /* Create the other tasks */ OSTaskCreate(_); : while (DEF_ON) { : : } } |