Fix a few compiler warnings when compiling the QueueSet.c test code with GCC.

pull/4/head
Richard Barry 12 years ago
parent d328ae3bfc
commit 96218c34a1

@ -86,9 +86,9 @@
#include "FreeRTOS.h" #include "FreeRTOS.h"
#include "task.h" #include "task.h"
/* Standard demo includes - just needed for the LED (ParTest) initialisation /* Standard demo includes. */
function. */
#include "partest.h" #include "partest.h"
#include "QueueSet.h"
/* Atmel library includes. */ /* Atmel library includes. */
#include <asf.h> #include <asf.h>
@ -200,3 +200,20 @@ void vApplicationStackOverflowHook( xTaskHandle pxTask, signed char *pcTaskName
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
void vApplicationTickHook( void )
{
/* This function will be called by each tick interrupt if
configUSE_TICK_HOOK is set to 1 in FreeRTOSConfig.h. User code can be
added here, but the tick hook is called from an interrupt context, so
code must not attempt to block, and only the interrupt safe FreeRTOS API
functions can be used (those that end in FromISR()). */
#if ( mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 0 )
{
/* In this case the tick hook is used as part of the queue set test. */
vQueueSetWriteToQueueFromISR();
}
#endif /* mainCREATE_SIMPLE_BLINKY_DEMO_ONLY */
}
/*-----------------------------------------------------------*/

@ -240,13 +240,3 @@ unsigned long ulReceivedValue;
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
void vApplicationTickHook( void )
{
/* This function will be called by each tick interrupt if
configUSE_TICK_HOOK is set to 1 in FreeRTOSConfig.h. User code can be
added here, but the tick hook is called from an interrupt context, so
code must not attempt to block, and only the interrupt safe FreeRTOS API
functions can be used (those that end in FromISR()). */
}
/*-----------------------------------------------------------*/

@ -314,15 +314,3 @@ unsigned long ulErrorFound = pdFALSE;
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
void vApplicationTickHook( void )
{
/* This function will be called by each tick interrupt if
configUSE_TICK_HOOK is set to 1 in FreeRTOSConfig.h. User code can be
added here, but the tick hook is called from an interrupt context, so
code must not attempt to block, and only the interrupt safe FreeRTOS API
functions can be used (those that end in FromISR()). In this case the tick
hook is used as part of the queue set test. */
vQueueSetWriteToQueueFromISR();
}
/*-----------------------------------------------------------*/

@ -79,8 +79,11 @@
* queuesetINITIAL_ISR_TX_VALUE to 0xffffffffUL; * queuesetINITIAL_ISR_TX_VALUE to 0xffffffffUL;
*/ */
/* Standard includes. */
#include <stdlib.h>
/* Kernel includes. */ /* Kernel includes. */
#include <FreeRTOS.h> #include "FreeRTOS.h"
#include "task.h" #include "task.h"
#include "queue.h" #include "queue.h"
@ -245,7 +248,7 @@ static unsigned long ulCallCount = 0;
if( xQueues[ x ] != NULL ) if( xQueues[ x ] != NULL )
{ {
/* xQueues[ x ] can be written to. Send the next value. */ /* xQueues[ x ] can be written to. Send the next value. */
if( xQueueSendFromISR( xQueues[ x ], &ulISRTxValue, NULL ) == pdPASS ) if( xQueueSendFromISR( xQueues[ x ], ( void * ) &ulISRTxValue, NULL ) == pdPASS )
{ {
ulISRTxValue++; ulISRTxValue++;

@ -1385,6 +1385,18 @@ static void prvUnlockQueue( xQueueHandle pxQueue )
{ {
#if ( configUSE_QUEUE_SETS == 1 ) #if ( configUSE_QUEUE_SETS == 1 )
{ {
/* It is highly unlikely that this code will ever run,
for the following reason:
+ A task will only lock a queue that is part of a
queue set when it is blocking on a write to the
queue.
+ An interrupt can only add something to a queue
while the queue is locked (resulting in the
following code executing when the queue is unlocked)
if the queue is not full, meaning a task will never
have blocked on a write in the first place.
The code could execute if an interrupt is also removing
items from a queue. */
if( pxQueue->pxQueueSetContainer != NULL ) if( pxQueue->pxQueueSetContainer != NULL )
{ {
if( prvNotifyQueueSetContainer( pxQueue, queueSEND_TO_BACK ) == pdTRUE ) if( prvNotifyQueueSetContainer( pxQueue, queueSEND_TO_BACK ) == pdTRUE )

Loading…
Cancel
Save