Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Unable to render {include} The included page could not be found.
Unable to render {include} The included page could not be found.

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:

OS_ERR_NONE
Always returns this value.

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) {

:

:

}

}

  • No labels