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] [September 2006 Threads] taskYIELD fromTickHookPosted by Nobody/Anonymous on September 7, 2006 Is any restrictions calling taskYIELD from TickHook?
freertos version v4.1.0 ATMEGA GCC port
>>-This code is working->> SIGNAL( SIG_OVERFLOW0 ) { portBASE_TYPE xTaskWoken = pdFALSE; TCNT0 = 125; TmrTickCtr++; if (TmrTickCtr >= TMR_DLY_TICKS) { TmrTickCtr = 0; xTaskWoken = xSemaphoreGiveFromISR( TmrSemTenths, xTaskWoken ); } if( xTaskWoken != pdFALSE ) { taskYIELD (); } }
>>-but this code not->>
void vApplicationTickHook( void ) { portBASE_TYPE xTaskWoken = pdFALSE; TmrTickCtr++; if (TmrTickCtr >= TMR_DLY_TICKS) { TmrTickCtr = 0; xTaskWoken = xSemaphoreGiveFromISR( TmrSemTenths, xTaskWoken ); } if( xTaskWoken != pdFALSE ) { taskYIELD (); } } stack underflow at vPortYieldFromTick()
RE: taskYIELD fromTickHookPosted by Nobody/Anonymous on September 7, 2006 Yes there are restriction - on most ports this is definitely not a good idea. In fact calling yield from any isr is not a good idea unless you use the macros provided in portmacro.h to do so, and follow the examples in the demos.
The actual answer is dependent on the port you are using. Each port yields in a different way.
In most cases yielding from the tick hook will not actually perform any useful function. This is because the tick hook is called prior to the yield being performed by the tick itself. Therefore if you hook wakes a task, then the tick code itself will yield if the woken task has a higher priority than the task that was interrupted.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|