# multiple calls to xQueueSendFromISR

**URL:** <https://forums.freertos.org/t/multiple-calls-to-xqueuesendfromisr/2544>\
**Category:** Kernel\
**Created:** [January 24, 2011, 10:42pm UTC](https://forums.freertos.org/t/multiple-calls-to-xqueuesendfromisr/2544 "2011-01-24T22:42:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [January 24, 2011, 10:42pm UTC](https://forums.freertos.org/t/multiple-calls-to-xqueuesendfromisr/2544/1 "2011-01-24T22:42:07Z")

</div>

**[clavrg](https://sourceforge.net/u/clavrg/)** wrote on [Monday, January 24, 2011](https://sourceforge.net/p/freertos/discussion/382005/thread/70bdd314/#6ef1):

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) { 
    portENTER_SWITCHING_ISR(); \
    portENTER_CRITICAL();
    bool taskAwaken = FALSE;
    taskAwaken = xQueueSendFromISR(_queue_1, &key, taskAwaken);
    taskAwaken = xQueueSendFromISR(_queue_2, &key, taskAwaken);
    portEXIT_CRITICAL();
    return taskAwaken;
    portEXIT_SWITCHING_ISR(); 
} 
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
```

---

<div class="post-metadata">

**Author:** ![richard-damon](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/richard-damon/32/38_2.png) [@richard-damon](https://forums.freertos.org/u/richard-damon)\
**Post date:** [January 24, 2011, 11:19pm UTC](https://forums.freertos.org/t/multiple-calls-to-xqueuesendfromisr/2544/2 "2011-01-24T23:19:59Z")

</div>

**[richard\_damon](https://sourceforge.net/u/richard_damon/)** wrote on [Monday, January 24, 2011](https://sourceforge.net/p/freertos/discussion/382005/thread/70bdd314/#66bd):

While I am not familiar with that port, the signature of xQueueSendFromISR changed in Version 5 to  
portBASE\_TYPE xQueueSendFromISR(  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xQueueHandle pxQueue,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; const void \*pvItemToQueue,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; portBASE\_TYPE \*pxHigherPriorityTaskWoken  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; );  
where the return value is NOT the new value of taskAwaken but a flag to indicate if the Send&nbsp; was successful or not.,&nbsp; 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);
