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] [April 2006 Threads] ApplicationTickHook repeated calls - bug??Posted by ClaytonG on April 21, 2006 I have used the Tick Hook as a means to drive a multiplexed LED display. However I soon found that it was not calling my Mux routine consistantly - it was often double or even triple calling it.
I have tracked this down to the MissedTicks processing in xTaskResumeAll (tasks.c) - this is also resulting in an vApplicationTickHook call (via vTaskIncrementTick ). So vApplicationTickHook gets called with each tick ISR (regardless of a proper tick handling or a tick miss), and then again when tick misses are handled.
The fix I have put into place is to remove the vApplicationTickHook from vTaskIncrementTick (task.c) and instead put it into the vPortYieldFromTick call (port.c) - this does however mean that all portable code needs this change - I have just changed my GCC-AVR port which this project uses.
I'm sure a better solution that does not involve portable code can be implemented in the next release - assuming of course that you agreee that the current behaviour is not correct :-)
On further thinking maybe the current behaviour is valid if the hook is doing something based on the tick count. Maybe two hooks are needed - a 'TickInterrupt' hook and a 'TickIncrement' hook??
RE: ApplicationTickHook repeated calls - bug??Posted by Nobody/Anonymous on April 21, 2006 If its a periodic hook that is required then the best way would be to somehow prevent the hook being called when the function is called from xTaskResumeAll(). I cannot see a neat way of doing this without using a parameter which would not be desirable.
RE: ApplicationTickHook repeated calls - bug?Posted by Nobody/Anonymous on April 21, 2006 You can call tickHook directly from the tickISR - take a look at the post from:
By: Nobody/Anonymous - nobody RE: Staggering Task Start Times 2005-12-16 04:26
You can find this by searching this forum for 'tickHook'.
HTH, John W.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|