Quality RTOS & Embedded Software

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


multiple calls to xQueueSendFromISR

Posted by rgavrilov on January 24, 2011
I call xQueueSendFromISR twice posting to two different queues. But only one task waiting on the queue gets awaken.

__attribute__((__naked__)) static void NAME(void) {
bool taskAwaken = FALSE;
taskAwaken = xQueueSendFromISR(_queue_1, &key, taskAwaken);
taskAwaken = xQueueSendFromISR(_queue_2, &key, taskAwaken);
return taskAwaken;

if I only post to one of two queues - the corresponding task is awaken as expected.

What am I doing wrong?

I use preemptive scheduling. Port: Atmel UC3A3256

RE: multiple calls to xQueueSendFromISR

Posted by Richard Damon on January 24, 2011
While I am not familiar with that port, the signature of xQueueSendFromISR changed in Version 5 to
portBASE_TYPE xQueueSendFromISR(
xQueueHandle pxQueue,
const void *pvItemToQueue,
portBASE_TYPE *pxHigherPriorityTaskWoken
where the return value is NOT the new value of taskAwaken but a flag to indicate if the Send was successful or not., thus your lines should be (not also the adding of an & when passing taskAwaken)

flag = xQueueSendFromISR(_queue_1, &key, &taskAwaken);
flag = xQueueSendFromISR(_queue_2, &key, &taskAwaken);

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

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

Latest News

Meet Richard Barry and learn what's new in the FreeRTOS project at Embedded World 2019

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


FreeRTOS and other embedded software careers at AWS.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

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

Xilinx Microblaze and Zynq partner