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] [June 2006 Threads] tickHook in tasks.c - 4.0.2Posted by John W. on June 1, 2006 Richard,
In the incrementTick task in tasks.c:
#if ( configUSE_TICK_HOOK == 1 ) { extern void vApplicationTickHook( void );
/* Guard against the tick hook being called when the missed tick count is being unwound (when the scheduler is being unlocked. */ if( uxMissedTicks == 0 ) { vApplicationTickHook(); } } #endif
I was wondering if it is 'incorrect' just to call tickHook directly from the tick ISR. If the scheduler is being unwound and the tickHook is called - what's the worst case scenario?
Note I've been calling tickHook from 3.X.X directly from the tick ISR and that target has been very stable. I'm not saying it's always correct - but it doesn't crash and I've done test runs for weeks.
Thanks! John W.
RE: tickHook in tasks.c - 4.0.2Posted by Richard on June 1, 2006 There is no technical problem as far as I can see in calling the tick hook from directly within the ISR. From my point of view of maintainability I want it to be within the scheduler C code so there is only one place for it to be maintained, rather than in every port.
The way V4.0.1 was calling the tick hook meant it was called both during the actual tick isr, and when the scheduler was being unsuspended. This meant that any ticks occurring when the scheduler was suspended would result in two calls of the tick hook - once during the actual isr and then again when the scheduler was unsuspended. I did not think this was a problem, but the way some people are using the tick hook it turned out not to be the case. The changes in V4.0.2 guard against this scenario, and I think is more logical/expected behaviour.
Of coarse calling the hook from the portable layer as you are you would never see this issue, and the portable layer code only runs during the genuine isr.
Regards.
RE: tickHook in tasks.c - 4.0.2Posted by John W. on June 1, 2006 Richard,
I tried calling the tickHook as you had it in 4.0.1 and it didn't work for my port. I'm not sure now if I told you or not. I promptly went back to the way I had it in 3.X.X and all was well.
I agree that portability is more important here.
Thanks! John W.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|