FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [October 2013 Threads]
I have 2 questions:
1) Is it safe to use functions *FromISR outside of interrupt routine i.e. in normal task which can be switchedin the middle of FromISR API? I need xQueueIsQueueFullFromISR but it does not have normal API.
2) I have this situation:
- thread 1 which is frequently blocked with xQueueSelectFromSet;
- thread 2 adds data in a queue with xQueueSend( ..., portMAX_DELAY );
- the queue is joined to queue set above;
Is there a chance to get dead lock if thread 1 is blocked, the corresponding queue is full and xQueueSend hang without unblocking thread 1? In other words - when the queue is full and thread blocked for some reason, will the xQueueSend unblock the thread and continue waiting for empty element in queue?
Whether or not you can use the "FromISR" functions outside of interrupts is somewhat dependent on the port. It is something I do myself as an optimisation sometimes, but generally I would not advise it to people who are not advanced users. If you are using a recent version of FreeRTOS on a Cortex-M device, you should be ok.
FreeRTOS V7.5.3 has a new API function uxQueueSpacesAvailable() which returns the number of spaces in the queue. That will do what you want I think.
You should not get deadlocks in your scenario - but be sure to follow the instructions on using queue sets with regards to ensuring the queue size of the queue set is at least equal to the sum of the sizes (that is, the maximum number of items that can be held within) of the queues added to the set.
Regards.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.