Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- TaskStatus_t *pxTaskStatusArray;
- volatile UBaseType_t uxArraySize, x;
- unsigned long ulTotalRunTime, ulStatsAsPercentage;
- ulStatsAsPercentage =
- pxTaskStatusArray[ x ].ulRunTimeCounter / ulTotalRunTime;
- pxTaskStatusArray = (TaskStatus_t*)pvPortMalloc( uxArraySize * sizeof( TaskStatus_t ) );
- if( ulStatsAsPercentage > 0UL )
- {
- sprintf( pcWriteBuffer, "%stt%lutt%lu%%rn",
- pxTaskStatusArray[ x ].pcTaskName,
- pxTaskStatusArray[ x ].ulRunTimeCounter,
- ulStatsAsPercentage );
- }
- else
- {
- /* If the percentage is zero here then the task has
- consumed less than 1% of the total run time. */
- sprintf( pcWriteBuffer, "%stt%lutt<1%%rn",
- pxTaskStatusArray[ x ].pcTaskName,
- pxTaskStatusArray[ x ].ulRunTimeCounter );
- }
Add Comment
Please, Sign In to add comment