MCPcopy Create free account
hub / github.com/FreeRTOS/FreeRTOS-Kernel / prvCopyDataFromQueue

Function prvCopyDataFromQueue

queue.c:2213–2231  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2211/*-----------------------------------------------------------*/
2212
2213static void prvCopyDataFromQueue( Queue_t * const pxQueue,
2214 void * const pvBuffer )
2215{
2216 if( pxQueue->uxItemSize != ( UBaseType_t ) 0 )
2217 {
2218 pxQueue->u.xQueue.pcReadFrom += pxQueue->uxItemSize; /*lint !e9016 Pointer arithmetic on char types ok, especially in this use case where it is the clearest way of conveying intent. */
2219
2220 if( pxQueue->u.xQueue.pcReadFrom >= pxQueue->u.xQueue.pcTail ) /*lint !e946 MISRA exception justified as use of the relational operator is the cleanest solutions. */
2221 {
2222 pxQueue->u.xQueue.pcReadFrom = pxQueue->pcHead;
2223 }
2224 else
2225 {
2226 mtCOVERAGE_TEST_MARKER();
2227 }
2228
2229 ( void ) memcpy( ( void * ) pvBuffer, ( void * ) pxQueue->u.xQueue.pcReadFrom, ( size_t ) pxQueue->uxItemSize ); /*lint !e961 !e418 !e9087 MISRA exception as the casts are only redundant for some ports. Also previous logic ensures a null pointer can only be passed to memcpy() when the count is 0. Cast to void required by function signature and safe as no alignment requirement and copy length specified in bytes. */
2230 }
2231}
2232/*-----------------------------------------------------------*/
2233
2234static void prvUnlockQueue( Queue_t * const pxQueue )

Callers 4

xQueueReceiveFunction · 0.85
xQueuePeekFunction · 0.85
xQueueReceiveFromISRFunction · 0.85
xQueuePeekFromISRFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected