xTaskGetTickCount not counting

zaphodbe wrote on Saturday, June 07, 2008:

I noticed an issue where when vTaskSuspendAll has been called to suspend the scheduler the xTickCount is no longer incremented and instead a count of ticks missed is kept in uxMissedTicks. 

In the code between the suspend and the resume I was using the TickCount returned by xTaskGetTickCount to time off some signals. 

Is there any reason why xTaskGetTickCount should not be modified to return the sum of the xTickCount and uxMissedTicks such that it returns a real tick time while suspended?


rtel wrote on Saturday, June 07, 2008:

While the scheudler is suspended all the tick counts are held pending and unwound when the scheduler is unsuspended.  This is part of the suspension, the scheduler is not supposed to be running.

You could implement a tick hook or one of the trace macros to provide an alternative time source that keeps running all the time.


zaphodbe wrote on Saturday, June 07, 2008:

Yes I agree with the operation from the scheduler perspective, however the definition for xTaskGetTickCount says the number of ticks since vTaskStartScheduler was called not the number of ticks that have been operated upon.

It appears that the Kernel itself does not use xTaskGetTickCount so having it return the sum of the current ticks executed plus the number of ticks pending would then match the description of the function?  Alternatively the description should probably change so somebody else doesn’t make the same mistake.