I have updated the SVN repository with a preview of what will be in the V4.5.0 release. As follows: + Added xQueueSendToBack(). This does the same as xQueueSend(). + Added xQueueSendToFront(). Allows data to be placed into the front of a queue. This is for high priority data. + Added xQueuePeek(). Allows an item to be retrieved from a queue without actually removing the item from the queue. + Added Mutex type semaphores. These are very similar to the existing binary semaphores but include a priority inheritance mechanism. See the semphr.h header file for the macro xSemaphoreCreateMutex() for usage information. configUSE_MUTEXES must be set to 1 in FreeRTOSConfig.h to use this feature. + Added demo source file GenQTest.c This demonstrates the usage of the above new features. The Demo/PC project for OpenWatcom has been updated to include the new demo. These files should not yet be considered complete but I am not as yet aware of any issues they contain. Feedback is appreciated. For information – the LPC2129 demo built to 9116 bytes using FreeRTOS.org V4.4.0 and 9180 bytes with the above updates (but with configUSE_MUTEXES set to 0 for a like for like comparison). Regards, Richard.
Richard, Awesome – thanks for posting. I’ll give them a whirl and let you know. Best Regards, John
I’ve been waiting for something like xQueuePeek forever. I can also come up some uses for xQueueSendToFront as well. I avoid mutex’s, but some people can’t code without them. priority inheritance is a good addition. I think The only thing that’s missing now, is the ability to block on several queues at the same time. If you could add that, that would be sweet. I’ll try to add this version into the skyeye freertos that I have now with the genQtest.c -Sashi
I’m getting a couple of warnings when I’m compiling for an arm under gcc FreeRTOS_CORE/queue.c: In function ‘xQueueGenericReceive’: FreeRTOS_CORE/queue.c:549: warning: cast increases required alignment of target type FreeRTOS_CORE/queue.c: In function ‘prvCopyDataToQueue’: FreeRTOS_CORE/queue.c:722: warning: cast increases required alignment of target type but running vStartGenericQueueTasks() in GenQTest.c seems to work fine. I added a print statement in case of errors and I don’t see any pop up.
>I avoid mutex’s, but some people can’t code without them. I agree with you here. The problem is all books tell you to perform mutual exclusion in this way, but personally I try and avoid it in all but extreme cases. >priority inheritance is a good addition Again – this is something people ask me for all the time hence the implementation, but I prefer to design the code in such a way that it is not required. Priority inheritance limits the effect of priority inversion, it does not cure it, best to avoid the inversion in the first place. Just my personal two cents. Regards.
Thanks for the information. I tried it with 4 different compilers and did not get that warning. Maybe I have it turned off? On those lines there is the case ( xTaskHandle * const ), could you try changing this to ( void * const ) to see if the warning persists. Thanks.
changing to ( void * const ) got rid of the warnings.
I have updated the SVN copy with the void*’s. Regards.
Misprint in "queue.h": #define xQueueSendToFromFromISR(…. ____________________^^^^
Oops, thats not good. Fixed, thanks.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.