Message queues

Message queues are quite similar. In CMSIS-RTOS, all queues are registered by name, which can make for a richer debugging experience. Also, CMSIS-RTOS supports static allocation via attributes passed in as function parameters.

Any functions called from inside an ISR will automatically be forced to use the FromISR equivalent functions and finish the ISR with a call to portYIELD_FROM_ISR. This results in any blocking times being effectively set to 0. So, for example, if a queue doesn't have space available, a call to osMessageQueuePut will return immediately from inside an ISR, even if a blocking timeout is specified:

CMSIS-RTOS name

FreeRTOS functions called

Notes

osMessageQueueDelete

vQueueUnregisterQueue, vQueueDelete

osMessageQueueGet

xQueueReceive

The FromISR variant is automatically called and portYIELD_FROM_ISR is automatically called if inside an ISR.

osMessageQueueGetCapacity

pxQueue->uxLength

osMessageQueueGetCount

uxQueueMessagesWaiting, uxQueueMessagesWaitingFromISR

osMessageQueueGetMsgSize

pxQueue->uxItemSize

osMessageQueueGetSpace

uxQueueSpacesAvailable

taskENTER_CRITICAL_FROM_ISR is automatically called if this function is executed from within an ISR.

osMessageQueueNew

xQueueCreateStatic, xQueueCreate

osMessageQueuePut

xQueueSendToBack, xQueueSendToBackFromISR

The msg_prior parameter is ignored in the STM port.

osMessageQueueReset

xQueueReset

 

Queues are very similar between CMSIS-RTOS and FreeRTOS, but it is worth noting that CMSIS-RTOS doesn't have an equivalent of xQueueSendToFront, so it will not be possible to place items at the front of a queue using CMSIS-RTOS.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.136.97.64