FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [August 2008 Threads] portTickType xTaskGetTickCount( void )Posted by David Farrell on 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.
RE: portTickType xTaskGetTickCount( void )Posted by Richard on 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.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|