A few updates for coding standard reasons.

pull/4/head
Richard Barry 14 years ago
parent 5063200c86
commit 254b61871e

@ -67,7 +67,10 @@ task.h is included from an application file. */
#include "FreeRTOS.h" #include "FreeRTOS.h"
#include "task.h" #include "task.h"
#if ( configUSE_CO_ROUTINES == 1 )
#include "croutine.h" #include "croutine.h"
#endif
#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE #undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE
@ -93,9 +96,9 @@ task.h is included from an application file. */
/* Semaphores do not actually store or copy data, so have an items size of /* Semaphores do not actually store or copy data, so have an items size of
zero. */ zero. */
#define queueSEMAPHORE_QUEUE_ITEM_LENGTH ( 0 ) #define queueSEMAPHORE_QUEUE_ITEM_LENGTH ( ( unsigned portBASE_TYPE ) 0 )
#define queueDONT_BLOCK ( ( portTickType ) 0 ) #define queueDONT_BLOCK ( ( portTickType ) 0U )
#define queueMUTEX_GIVE_BLOCK_TIME ( ( portTickType ) 0 ) #define queueMUTEX_GIVE_BLOCK_TIME ( ( portTickType ) 0U )
/* /*
* Definition of the queue used by the scheduler. * Definition of the queue used by the scheduler.
@ -539,7 +542,7 @@ xTimeOutType xTimeOut;
/* Update the timeout state to see if it has expired yet. */ /* Update the timeout state to see if it has expired yet. */
if( xTaskCheckForTimeOut( &xTimeOut, &xTicksToWait ) == pdFALSE ) if( xTaskCheckForTimeOut( &xTimeOut, &xTicksToWait ) == pdFALSE )
{ {
if( prvIsQueueFull( pxQueue ) ) if( prvIsQueueFull( pxQueue ) != pdFALSE )
{ {
traceBLOCKING_ON_QUEUE_SEND( pxQueue ); traceBLOCKING_ON_QUEUE_SEND( pxQueue );
vTaskPlaceOnEventList( &( pxQueue->xTasksWaitingToSend ), xTicksToWait ); vTaskPlaceOnEventList( &( pxQueue->xTasksWaitingToSend ), xTicksToWait );
@ -556,7 +559,7 @@ xTimeOutType xTimeOut;
task is already in a ready list before it yields - in which task is already in a ready list before it yields - in which
case the yield will not cause a context switch unless there case the yield will not cause a context switch unless there
is also a higher priority task in the pending ready list. */ is also a higher priority task in the pending ready list. */
if( !xTaskResumeAll() ) if( xTaskResumeAll() == pdFALSE )
{ {
portYIELD_WITHIN_API(); portYIELD_WITHIN_API();
} }
@ -639,7 +642,7 @@ xTimeOutType xTimeOut;
{ {
if( xTaskCheckForTimeOut( &xTimeOut, &xTicksToWait ) == pdFALSE ) if( xTaskCheckForTimeOut( &xTimeOut, &xTicksToWait ) == pdFALSE )
{ {
if( prvIsQueueFull( pxQueue ) ) if( prvIsQueueFull( pxQueue ) != pdFALSE )
{ {
traceBLOCKING_ON_QUEUE_SEND( pxQueue ); traceBLOCKING_ON_QUEUE_SEND( pxQueue );
vTaskPlaceOnEventList( &( pxQueue->xTasksWaitingToSend ), xTicksToWait ); vTaskPlaceOnEventList( &( pxQueue->xTasksWaitingToSend ), xTicksToWait );
@ -755,7 +758,7 @@ xTimeOutType xTimeOut;
{ {
if( xTaskCheckForTimeOut( &xTimeOut, &xTicksToWait ) == pdFALSE ) if( xTaskCheckForTimeOut( &xTimeOut, &xTicksToWait ) == pdFALSE )
{ {
if( prvIsQueueEmpty( pxQueue ) ) if( prvIsQueueEmpty( pxQueue ) != pdFALSE )
{ {
traceBLOCKING_ON_QUEUE_RECEIVE( pxQueue ); traceBLOCKING_ON_QUEUE_RECEIVE( pxQueue );
@ -954,7 +957,7 @@ signed char *pcOriginalReadPosition;
/* Update the timeout state to see if it has expired yet. */ /* Update the timeout state to see if it has expired yet. */
if( xTaskCheckForTimeOut( &xTimeOut, &xTicksToWait ) == pdFALSE ) if( xTaskCheckForTimeOut( &xTimeOut, &xTicksToWait ) == pdFALSE )
{ {
if( prvIsQueueEmpty( pxQueue ) ) if( prvIsQueueEmpty( pxQueue ) != pdFALSE )
{ {
traceBLOCKING_ON_QUEUE_RECEIVE( pxQueue ); traceBLOCKING_ON_QUEUE_RECEIVE( pxQueue );
@ -973,7 +976,7 @@ signed char *pcOriginalReadPosition;
vTaskPlaceOnEventList( &( pxQueue->xTasksWaitingToReceive ), xTicksToWait ); vTaskPlaceOnEventList( &( pxQueue->xTasksWaitingToReceive ), xTicksToWait );
prvUnlockQueue( pxQueue ); prvUnlockQueue( pxQueue );
if( !xTaskResumeAll() ) if( xTaskResumeAll() == pdFALSE )
{ {
portYIELD_WITHIN_API(); portYIELD_WITHIN_API();
} }
@ -1260,7 +1263,7 @@ signed portBASE_TYPE xReturn;
between the check to see if the queue is full and blocking on the queue. */ between the check to see if the queue is full and blocking on the queue. */
portDISABLE_INTERRUPTS(); portDISABLE_INTERRUPTS();
{ {
if( prvIsQueueFull( pxQueue ) ) if( prvIsQueueFull( pxQueue ) != pdFALSE )
{ {
/* The queue is full - do we want to block or just leave without /* The queue is full - do we want to block or just leave without
posting? */ posting? */
@ -1404,7 +1407,7 @@ signed portBASE_TYPE xQueueCRSendFromISR( xQueueHandle pxQueue, const void *pvIt
/* We only want to wake one co-routine per ISR, so check that a /* We only want to wake one co-routine per ISR, so check that a
co-routine has not already been woken. */ co-routine has not already been woken. */
if( !xCoRoutinePreviouslyWoken ) if( xCoRoutinePreviouslyWoken == pdFALSE )
{ {
if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToReceive ) ) == pdFALSE ) if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToReceive ) ) == pdFALSE )
{ {
@ -1439,7 +1442,7 @@ signed portBASE_TYPE xReturn;
--( pxQueue->uxMessagesWaiting ); --( pxQueue->uxMessagesWaiting );
memcpy( ( void * ) pvBuffer, ( void * ) pxQueue->pcReadFrom, ( unsigned ) pxQueue->uxItemSize ); memcpy( ( void * ) pvBuffer, ( void * ) pxQueue->pcReadFrom, ( unsigned ) pxQueue->uxItemSize );
if( !( *pxCoRoutineWoken ) ) if( ( *pxCoRoutineWoken ) == pdFALSE )
{ {
if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToSend ) ) == pdFALSE ) if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToSend ) ) == pdFALSE )
{ {
@ -1470,7 +1473,7 @@ signed portBASE_TYPE xReturn;
/* See if there is an empty space in the registry. A NULL name denotes /* See if there is an empty space in the registry. A NULL name denotes
a free slot. */ a free slot. */
for( ux = ( unsigned portBASE_TYPE ) 0U; ux < configQUEUE_REGISTRY_SIZE; ux++ ) for( ux = ( unsigned portBASE_TYPE ) 0U; ux < ( unsigned portBASE_TYPE ) configQUEUE_REGISTRY_SIZE; ux++ )
{ {
if( xQueueRegistry[ ux ].pcQueueName == NULL ) if( xQueueRegistry[ ux ].pcQueueName == NULL )
{ {
@ -1493,7 +1496,7 @@ signed portBASE_TYPE xReturn;
/* See if the handle of the queue being unregistered in actually in the /* See if the handle of the queue being unregistered in actually in the
registry. */ registry. */
for( ux = ( unsigned portBASE_TYPE ) 0U; ux < configQUEUE_REGISTRY_SIZE; ux++ ) for( ux = ( unsigned portBASE_TYPE ) 0U; ux < ( unsigned portBASE_TYPE ) configQUEUE_REGISTRY_SIZE; ux++ )
{ {
if( xQueueRegistry[ ux ].xHandle == xQueue ) if( xQueueRegistry[ ux ].xHandle == xQueue )
{ {

Loading…
Cancel
Save