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).
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.