Guest User

Untitled

a guest
May 22nd, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. TaskStatus_t *pxTaskStatusArray;
  2. volatile UBaseType_t uxArraySize, x;
  3. unsigned long ulTotalRunTime, ulStatsAsPercentage;
  4.  
  5. ulStatsAsPercentage =
  6. pxTaskStatusArray[ x ].ulRunTimeCounter / ulTotalRunTime;
  7.  
  8. pxTaskStatusArray = (TaskStatus_t*)pvPortMalloc( uxArraySize * sizeof( TaskStatus_t ) );
  9.  
  10. if( ulStatsAsPercentage > 0UL )
  11. {
  12. sprintf( pcWriteBuffer, "%stt%lutt%lu%%rn",
  13. pxTaskStatusArray[ x ].pcTaskName,
  14. pxTaskStatusArray[ x ].ulRunTimeCounter,
  15. ulStatsAsPercentage );
  16. }
  17. else
  18. {
  19. /* If the percentage is zero here then the task has
  20. consumed less than 1% of the total run time. */
  21. sprintf( pcWriteBuffer, "%stt%lutt<1%%rn",
  22. pxTaskStatusArray[ x ].pcTaskName,
  23. pxTaskStatusArray[ x ].ulRunTimeCounter );
  24. }
Add Comment
Please, Sign In to add comment