Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training




Loading

taskYIELD fromTickHook

Posted 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 fromTickHook

Posted 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.


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists