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


Timer callbacks

Posted by Paul Coleman on March 12, 2012
If I give a semaphore from within a software timer callback do I need to use xSemaphoreGiveFromISR() version?

Thanks, Paul.

RE: Timer callbacks

Posted by Richard on March 12, 2012
No. Timer callbacks run in the context of a task, so the non ISR version can be used. If the function is being called from a timer callback then the block time must be set to 0.


RE: Timer callbacks

Posted by Paul Coleman on March 12, 2012
I'm not sure which function you're referring to and xSemaphoreGive doesn't have a block time?

Thanks, Paul.

RE: Timer callbacks

Posted by Richard Damon on March 12, 2012
I think Richard was just making a general comment so that if, for example, a timer function wanted to put or get data from a queue that it should use a zero block time.

I would use the word should rather than must here, as unlike in the idle hook, where blocking will likely cause a kernel crash (as suddenly NO task is ready to run), a block in a timer function doesn't cause this level of problem, the user just needs to realize that if one timer function blocks, it block the whole timer task, so no other timer functions will run, nor will the program be able to process any new timer requests (they can be queued up in the timer queue until full, but the timer task won't be removing them). There may be special conditions where this is acceptable.

RE: Timer callbacks

Posted by Paul Coleman on March 12, 2012
Okay I see, thanks for the clarification :o)

[ 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