portTickType xTaskGetTickCount( void )

david_farrell wrote on Friday, August 15, 2008:

Why is xTaskGetTickCount not like this?

#if configUSE_16_BIT_TICKS == 0
    xTicks = xTickCount;
#else
    /* Critical section required if running on a 16 bit processor. */
    taskENTER_CRITICAL();
    {
        xTicks = xTickCount;
    }
    taskEXIT_CRITICAL();
#endif

Thanks Richard B. for a great package!

David.

rtel wrote on Friday, August 15, 2008:

You are not the first to point that out.  There are several optimisations that could be made along these lines.

A couple of notes:

1) One of the original aims was to avoid using conditional compilation in this way - although this goal already went South as more features and ports were added.

2) Its not just a 16bit ticks definition thing, consider also the case where an 8bit processor is using 16bit tick values.  Also, when using a 32bit processor and 32bit ticks you can remove the whole thing.

Regards.