From 9e05eaaf91c2596521e29b90ffa9adf3114c3b93 Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Fri, 28 Jan 2011 20:11:32 +0100 Subject: Proper mutex usage, and protecting malloc and sbrk using them. Also showing this into the demo. --- FreeRTOS/Source/queue.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'FreeRTOS') diff --git a/FreeRTOS/Source/queue.c b/FreeRTOS/Source/queue.c index a62d179..b34e102 100644 --- a/FreeRTOS/Source/queue.c +++ b/FreeRTOS/Source/queue.c @@ -53,6 +53,7 @@ #include #include +#include /* Defining MPU_WRAPPERS_INCLUDED_FROM_API_FILE prevents task.h from redefining all the API functions to use the MPU wrappers. That should only be done when @@ -1092,11 +1093,20 @@ static void prvCopyDataFromQueue( xQUEUE * const pxQueue, const void *pvBuffer ) { if( pxQueue->uxQueueType != queueQUEUE_IS_MUTEX ) { + DBGOUT("ret: %p\r\n", __builtin_return_address(0)); + DBGOUT("pxQueue: %p\r\n", pxQueue); + DBGOUT("pxQueue->uxQueueType: %d\r\n", pxQueue->uxQueueType); + DBGOUT("pxQueue->pcReadFrom: %p\r\n", pxQueue->pcReadFrom); + DBGOUT("pxQueue->uxItemSize: %d\r\n", pxQueue->uxItemSize); pxQueue->pcReadFrom += pxQueue->uxItemSize; + DBGOUT("pxQueue->pcReadFrom: %p\r\n", pxQueue->pcReadFrom); if( pxQueue->pcReadFrom >= pxQueue->pcTail ) { pxQueue->pcReadFrom = pxQueue->pcHead; } + DBGOUT("pxQueue->pcHead: %p\r\n", pxQueue->pcHead); + DBGOUT("pxQueue->pcReadFrom: %p\r\n", pxQueue->pcReadFrom); + DBGOUT("pvBuffer: %p\r\n", pvBuffer); memcpy( ( void * ) pvBuffer, ( void * ) pxQueue->pcReadFrom, ( unsigned ) pxQueue->uxItemSize ); } } -- cgit v1.2.3