mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-01 09:24:10 +01:00
Updated Idle comments.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@50 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
28e9081872
commit
db322beabb
@ -29,7 +29,8 @@
|
||||
|
||||
|
||||
/* Local Variables */
|
||||
static unsigned long ulIdleCycleCount = 0UL;
|
||||
static uint32_t ulIdleCycleCount = 0;
|
||||
static uint32_t IdleTimePercent = 0;
|
||||
|
||||
/* Local Functions */
|
||||
static void ServosTask(void *pvParameters);
|
||||
@ -73,13 +74,15 @@ static void ServosTask(void *pvParameters)
|
||||
*/
|
||||
void vApplicationIdleHook(void)
|
||||
{
|
||||
uint32_t IdleTimePercent = 0;
|
||||
|
||||
/* Called when the scheduler has no tasks to run */
|
||||
/* In here we could implement stats for FreeRTOS */
|
||||
/* In here we could implement full stats for FreeRTOS
|
||||
Although this would need us to enable stats in FreeRTOS
|
||||
which is *very* costly. With the function below we can
|
||||
either print it out or just watch the variable using JTAG */
|
||||
|
||||
/* This can give a basic indication of how much time the system spends in idle */
|
||||
/* IdleTimePercent is the percentage of time spent in idle since the scheduler started */
|
||||
/* For example a value of 75 would mean we are spending 75% of FreeRTOS Cycles in idle */
|
||||
ulIdleCycleCount++;
|
||||
IdleTimePercent = ((ulIdleCycleCount / xTaskGetTickCount()) * 100);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user