Quality RTOS & Embedded Software

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




Loading

xSemaphoreGiveFromISR from context of a task

Posted by ARMinator on March 20, 2009
Hi,

Sorry if this post appears twice, my first attempt seems to have failed.

I need to write that piece of code that is generic enough that it allows giving a semaphore from the context of either an ISR or a task. Since an ISR must use xSemaphoreGiveFromISR to give semaphores, is it possible to use xSemaphoreGiveFromISR in the context of a task?

If so, any cons with doing this?

Jean

RE: xSemaphoreGiveFromISR from context of a t

Posted by Richard on March 20, 2009
You can use xQueueGenericSendFromISR() from a task but need to take care of critical sections. The ISR version uses portSET_INTERRUPT_MASK_FROM_ISR() which is only defined for ports that use interrupt nesting. You would need to implement an equivalent for your port if it were not already defined.

Regards.


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




Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

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

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

OpenRTOS and SafeRTOS