Remove white space only.

pull/4/head
Richard Barry 17 years ago
parent f68aab980d
commit adf9eb9fb0

@ -227,7 +227,6 @@ void vStartInterruptQueueTasks( void )
defined to be less than 1. */ defined to be less than 1. */
vQueueAddToRegistry( xNormallyFullQueue, ( signed portCHAR * ) "NormallyFull" ); vQueueAddToRegistry( xNormallyFullQueue, ( signed portCHAR * ) "NormallyFull" );
vQueueAddToRegistry( xNormallyEmptyQueue, ( signed portCHAR * ) "NormallyEmpty" ); vQueueAddToRegistry( xNormallyEmptyQueue, ( signed portCHAR * ) "NormallyEmpty" );
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
@ -241,7 +240,7 @@ static void prvRecordValue_NormallyFull( unsigned portBASE_TYPE uxValue, unsigne
{ {
prvQueueAccessLogError( __LINE__ ); prvQueueAccessLogError( __LINE__ );
} }
/* Log that this value has been received. */ /* Log that this value has been received. */
ucNormallyFullReceivedValues[ uxValue ] = uxSource; ucNormallyFullReceivedValues[ uxValue ] = uxSource;
} }
@ -258,7 +257,7 @@ static void prvRecordValue_NormallyEmpty( unsigned portBASE_TYPE uxValue, unsign
{ {
prvQueueAccessLogError( __LINE__ ); prvQueueAccessLogError( __LINE__ );
} }
/* Log that this value has been received. */ /* Log that this value has been received. */
ucNormallyEmptyReceivedValues[ uxValue ] = uxSource; ucNormallyEmptyReceivedValues[ uxValue ] = uxSource;
} }
@ -299,20 +298,20 @@ unsigned portBASE_TYPE uxRxed, ux, uxTask1, uxTask2;
values are received and no values are duplicated. */ values are received and no values are duplicated. */
prvRecordValue_NormallyEmpty( uxRxed, ( unsigned portBASE_TYPE ) pvParameters ); prvRecordValue_NormallyEmpty( uxRxed, ( unsigned portBASE_TYPE ) pvParameters );
} }
/* Ensure the other task running this code gets a chance to execute. */ /* Ensure the other task running this code gets a chance to execute. */
taskYIELD(); taskYIELD();
if( ( unsigned portBASE_TYPE ) pvParameters == intqHIGH_PRIORITY_TASK1 ) if( ( unsigned portBASE_TYPE ) pvParameters == intqHIGH_PRIORITY_TASK1 )
{ {
/* Have we received all the expected values? */ /* Have we received all the expected values? */
if( uxValueForNormallyEmptyQueue > ( intqNUM_VALUES_TO_LOG + intqVALUE_OVERRUN ) ) if( uxValueForNormallyEmptyQueue > ( intqNUM_VALUES_TO_LOG + intqVALUE_OVERRUN ) )
{ {
vTaskSuspend( xHighPriorityNormallyEmptyTask2 ); vTaskSuspend( xHighPriorityNormallyEmptyTask2 );
uxTask1 = 0; uxTask1 = 0;
uxTask2 = 0; uxTask2 = 0;
/* Loop through the array, checking that both tasks have /* Loop through the array, checking that both tasks have
placed values into the array, and that no values are missing. */ placed values into the array, and that no values are missing. */
for( ux = 0; ux < intqNUM_VALUES_TO_LOG; ux++ ) for( ux = 0; ux < intqNUM_VALUES_TO_LOG; ux++ )
@ -336,22 +335,22 @@ unsigned portBASE_TYPE uxRxed, ux, uxTask1, uxTask2;
} }
} }
} }
if( uxTask1 < intqMIN_ACCEPTABLE_TASK_COUNT ) if( uxTask1 < intqMIN_ACCEPTABLE_TASK_COUNT )
{ {
/* Only task 2 seemed to log any values. */ /* Only task 2 seemed to log any values. */
prvQueueAccessLogError( __LINE__ ); prvQueueAccessLogError( __LINE__ );
} }
if( uxTask2 < intqMIN_ACCEPTABLE_TASK_COUNT ) if( uxTask2 < intqMIN_ACCEPTABLE_TASK_COUNT )
{ {
/* Only task 1 seemed to log any values. */ /* Only task 1 seemed to log any values. */
prvQueueAccessLogError( __LINE__ ); prvQueueAccessLogError( __LINE__ );
} }
/* Clear the array again, ready to start a new cycle. */ /* Clear the array again, ready to start a new cycle. */
memset( ucNormallyEmptyReceivedValues, 0x00, sizeof( ucNormallyEmptyReceivedValues ) ); memset( ucNormallyEmptyReceivedValues, 0x00, sizeof( ucNormallyEmptyReceivedValues ) );
uxHighPriorityLoops1++; uxHighPriorityLoops1++;
uxValueForNormallyEmptyQueue = 0; uxValueForNormallyEmptyQueue = 0;
@ -361,7 +360,7 @@ unsigned portBASE_TYPE uxRxed, ux, uxTask1, uxTask2;
priority tasks. The lower priority task will resume us priority tasks. The lower priority task will resume us
if it receives something. We will then resume the other if it receives something. We will then resume the other
higher priority task. */ higher priority task. */
vTaskSuspend( NULL ); vTaskSuspend( NULL );
vTaskResume( xHighPriorityNormallyEmptyTask2 ); vTaskResume( xHighPriorityNormallyEmptyTask2 );
} }
} }
@ -376,9 +375,9 @@ portBASE_TYPE xQueueStatus;
/* The parameters are not being used so avoid compiler warnings. */ /* The parameters are not being used so avoid compiler warnings. */
( void ) pvParameters; ( void ) pvParameters;
for( ;; ) for( ;; )
{ {
if( ( xQueueStatus = xQueueReceive( xNormallyEmptyQueue, &uxRxed, intqONE_TICK_DELAY ) ) != errQUEUE_EMPTY ) if( ( xQueueStatus = xQueueReceive( xNormallyEmptyQueue, &uxRxed, intqONE_TICK_DELAY ) ) != errQUEUE_EMPTY )
{ {
/* We should only obtain a value when the high priority task is /* We should only obtain a value when the high priority task is
@ -389,7 +388,7 @@ portBASE_TYPE xQueueStatus;
} }
prvRecordValue_NormallyEmpty( uxRxed, intqLOW_PRIORITY_TASK ); prvRecordValue_NormallyEmpty( uxRxed, intqLOW_PRIORITY_TASK );
/* Wake the higher priority task again. */ /* Wake the higher priority task again. */
vTaskResume( xHighPriorityNormallyEmptyTask1 ); vTaskResume( xHighPriorityNormallyEmptyTask1 );
uxLowPriorityLoops1++; uxLowPriorityLoops1++;
@ -399,19 +398,19 @@ portBASE_TYPE xQueueStatus;
/* Raise our priority while we send so we can preempt the higher /* Raise our priority while we send so we can preempt the higher
priority task, and ensure we get the Tx value into the queue. */ priority task, and ensure we get the Tx value into the queue. */
vTaskPrioritySet( NULL, intqHIGHER_PRIORITY + 1 ); vTaskPrioritySet( NULL, intqHIGHER_PRIORITY + 1 );
portENTER_CRITICAL(); portENTER_CRITICAL();
{ {
uxValue = uxValueForNormallyEmptyQueue; uxValue = uxValueForNormallyEmptyQueue;
uxValueForNormallyEmptyQueue++; uxValueForNormallyEmptyQueue++;
} }
portEXIT_CRITICAL(); portEXIT_CRITICAL();
if( xQueueSend( xNormallyEmptyQueue, &uxValue, portMAX_DELAY ) != pdPASS ) if( xQueueSend( xNormallyEmptyQueue, &uxValue, portMAX_DELAY ) != pdPASS )
{ {
prvQueueAccessLogError( __LINE__ ); prvQueueAccessLogError( __LINE__ );
} }
vTaskPrioritySet( NULL, intqLOWER_PRIORITY ); vTaskPrioritySet( NULL, intqLOWER_PRIORITY );
} }
} }
@ -425,7 +424,7 @@ portBASE_TYPE xQueueStatus;
/* The parameters are not being used so avoid compiler warnings. */ /* The parameters are not being used so avoid compiler warnings. */
( void ) pvParameters; ( void ) pvParameters;
/* Make sure the queue starts full or near full. >> 1 as there are two /* Make sure the queue starts full or near full. >> 1 as there are two
high priority tasks. */ high priority tasks. */
for( ux = 0; ux < ( intqQUEUE_LENGTH >> 1 ); ux++ ) for( ux = 0; ux < ( intqQUEUE_LENGTH >> 1 ); ux++ )
@ -437,7 +436,7 @@ portBASE_TYPE xQueueStatus;
} }
portEXIT_CRITICAL(); portEXIT_CRITICAL();
xQueueSend( xNormallyFullQueue, &uxValueToTx, intqSHORT_DELAY ); xQueueSend( xNormallyFullQueue, &uxValueToTx, intqSHORT_DELAY );
} }
for( ;; ) for( ;; )
@ -458,27 +457,27 @@ portBASE_TYPE xQueueStatus;
/* Allow the other task running this code to run. */ /* Allow the other task running this code to run. */
taskYIELD(); taskYIELD();
/* Have all the expected values been sent to the queue? */ /* Have all the expected values been sent to the queue? */
if( uxValueToTx > ( intqNUM_VALUES_TO_LOG + intqVALUE_OVERRUN ) ) if( uxValueToTx > ( intqNUM_VALUES_TO_LOG + intqVALUE_OVERRUN ) )
{ {
/* Make sure the other high priority task completes its send of /* Make sure the other high priority task completes its send of
any values below intqNUM_VALUE_TO_LOG. */ any values below intqNUM_VALUE_TO_LOG. */
vTaskDelay( intqSHORT_DELAY ); vTaskDelay( intqSHORT_DELAY );
vTaskSuspend( xHighPriorityNormallyFullTask2 ); vTaskSuspend( xHighPriorityNormallyFullTask2 );
if( xWasSuspended == pdTRUE ) if( xWasSuspended == pdTRUE )
{ {
/* We would have expected the other high priority task to have /* We would have expected the other high priority task to have
set this back to false by now. */ set this back to false by now. */
prvQueueAccessLogError( __LINE__ ); prvQueueAccessLogError( __LINE__ );
} }
/* Set the suspended flag so an error is not logged if the other /* Set the suspended flag so an error is not logged if the other
task recognises a time out when it is unsuspended. */ task recognises a time out when it is unsuspended. */
xWasSuspended = pdTRUE; xWasSuspended = pdTRUE;
for( ux = 0; ux < intqNUM_VALUES_TO_LOG; ux++ ) for( ux = 0; ux < intqNUM_VALUES_TO_LOG; ux++ )
{ {
if( ucNormallyFullReceivedValues[ ux ] == 0 ) if( ucNormallyFullReceivedValues[ ux ] == 0 )
@ -486,11 +485,11 @@ portBASE_TYPE xQueueStatus;
/* A value was missing. */ /* A value was missing. */
prvQueueAccessLogError( __LINE__ ); prvQueueAccessLogError( __LINE__ );
} }
} }
/* Reset the array ready for the next cycle. */ /* Reset the array ready for the next cycle. */
memset( ucNormallyFullReceivedValues, 0x00, sizeof( ucNormallyFullReceivedValues ) ); memset( ucNormallyFullReceivedValues, 0x00, sizeof( ucNormallyFullReceivedValues ) );
uxHighPriorityLoops2++; uxHighPriorityLoops2++;
uxValueForNormallyFullQueue = 0; uxValueForNormallyFullQueue = 0;
@ -500,7 +499,7 @@ portBASE_TYPE xQueueStatus;
priority tasks. The lower priority task will resume us priority tasks. The lower priority task will resume us
if it receives something. We will then resume the other if it receives something. We will then resume the other
higher priority task. */ higher priority task. */
vTaskSuspend( NULL ); vTaskSuspend( NULL );
vTaskResume( xHighPriorityNormallyFullTask2 ); vTaskResume( xHighPriorityNormallyFullTask2 );
} }
} }
@ -514,7 +513,7 @@ portBASE_TYPE xQueueStatus;
/* The parameters are not being used so avoid compiler warnings. */ /* The parameters are not being used so avoid compiler warnings. */
( void ) pvParameters; ( void ) pvParameters;
/* Make sure the queue starts full or near full. >> 1 as there are two /* Make sure the queue starts full or near full. >> 1 as there are two
high priority tasks. */ high priority tasks. */
for( ux = 0; ux < ( intqQUEUE_LENGTH >> 1 ); ux++ ) for( ux = 0; ux < ( intqQUEUE_LENGTH >> 1 ); ux++ )
@ -526,7 +525,7 @@ portBASE_TYPE xQueueStatus;
} }
portEXIT_CRITICAL(); portEXIT_CRITICAL();
xQueueSend( xNormallyFullQueue, &uxValueToTx, intqSHORT_DELAY ); xQueueSend( xNormallyFullQueue, &uxValueToTx, intqSHORT_DELAY );
} }
for( ;; ) for( ;; )
@ -548,7 +547,7 @@ portBASE_TYPE xQueueStatus;
} }
xWasSuspended = pdFALSE; xWasSuspended = pdFALSE;
taskYIELD(); taskYIELD();
} }
} }
@ -561,9 +560,9 @@ portBASE_TYPE xQueueStatus;
/* The parameters are not being used so avoid compiler warnings. */ /* The parameters are not being used so avoid compiler warnings. */
( void ) pvParameters; ( void ) pvParameters;
for( ;; ) for( ;; )
{ {
if( ( xQueueStatus = xQueueSend( xNormallyFullQueue, &uxTxed, intqONE_TICK_DELAY ) ) != errQUEUE_FULL ) if( ( xQueueStatus = xQueueSend( xNormallyFullQueue, &uxTxed, intqONE_TICK_DELAY ) ) != errQUEUE_FULL )
{ {
/* We would only expect to succeed when the higher priority task /* We would only expect to succeed when the higher priority task
@ -581,7 +580,7 @@ portBASE_TYPE xQueueStatus;
/* Raise our priority while we receive so we can preempt the higher /* Raise our priority while we receive so we can preempt the higher
priority task, and ensure we get the value from the queue. */ priority task, and ensure we get the value from the queue. */
vTaskPrioritySet( NULL, intqHIGHER_PRIORITY + 1 ); vTaskPrioritySet( NULL, intqHIGHER_PRIORITY + 1 );
if( xQueueReceive( xNormallyFullQueue, &uxValue, portMAX_DELAY ) != pdPASS ) if( xQueueReceive( xNormallyFullQueue, &uxValue, portMAX_DELAY ) != pdPASS )
{ {
prvQueueAccessLogError( __LINE__ ); prvQueueAccessLogError( __LINE__ );
@ -590,7 +589,7 @@ portBASE_TYPE xQueueStatus;
{ {
prvRecordValue_NormallyFull( uxValue, intqLOW_PRIORITY_TASK ); prvRecordValue_NormallyFull( uxValue, intqLOW_PRIORITY_TASK );
} }
vTaskPrioritySet( NULL, intqLOWER_PRIORITY ); vTaskPrioritySet( NULL, intqLOWER_PRIORITY );
} }
} }
@ -606,11 +605,11 @@ static unsigned portBASE_TYPE uxNextOperation = 0;
accesses on the queues. */ accesses on the queues. */
uxNextOperation++; uxNextOperation++;
if( uxNextOperation & ( unsigned portBASE_TYPE ) 0x01 ) if( uxNextOperation & ( unsigned portBASE_TYPE ) 0x01 )
{ {
timerNORMALLY_EMPTY_TX(); timerNORMALLY_EMPTY_TX();
timerNORMALLY_EMPTY_TX(); timerNORMALLY_EMPTY_TX();
timerNORMALLY_EMPTY_TX(); timerNORMALLY_EMPTY_TX();
} }
else else
@ -619,7 +618,7 @@ static unsigned portBASE_TYPE uxNextOperation = 0;
timerNORMALLY_FULL_RX(); timerNORMALLY_FULL_RX();
timerNORMALLY_FULL_RX(); timerNORMALLY_FULL_RX();
} }
return xHigherPriorityTaskWoken; return xHigherPriorityTaskWoken;
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
@ -634,7 +633,7 @@ static unsigned portBASE_TYPE uxNextOperation = 0;
accesses on the queues. */ accesses on the queues. */
uxNextOperation++; uxNextOperation++;
if( uxNextOperation & ( unsigned portBASE_TYPE ) 0x01 ) if( uxNextOperation & ( unsigned portBASE_TYPE ) 0x01 )
{ {
timerNORMALLY_EMPTY_TX(); timerNORMALLY_EMPTY_TX();
@ -644,14 +643,14 @@ static unsigned portBASE_TYPE uxNextOperation = 0;
timerNORMALLY_EMPTY_RX(); timerNORMALLY_EMPTY_RX();
} }
else else
{ {
timerNORMALLY_FULL_RX(); timerNORMALLY_FULL_RX();
timerNORMALLY_FULL_TX(); timerNORMALLY_FULL_TX();
timerNORMALLY_FULL_TX(); timerNORMALLY_FULL_TX();
timerNORMALLY_FULL_TX(); timerNORMALLY_FULL_TX();
timerNORMALLY_FULL_TX(); timerNORMALLY_FULL_TX();
} }
return xHigherPriorityTaskWoken; return xHigherPriorityTaskWoken;
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
@ -660,7 +659,7 @@ static unsigned portBASE_TYPE uxNextOperation = 0;
portBASE_TYPE xAreIntQueueTasksStillRunning( void ) portBASE_TYPE xAreIntQueueTasksStillRunning( void )
{ {
static unsigned portBASE_TYPE uxLastHighPriorityLoops1 = 0, uxLastHighPriorityLoops2 = 0, uxLastLowPriorityLoops1 = 0, uxLastLowPriorityLoops2 = 0; static unsigned portBASE_TYPE uxLastHighPriorityLoops1 = 0, uxLastHighPriorityLoops2 = 0, uxLastLowPriorityLoops1 = 0, uxLastLowPriorityLoops2 = 0;
/* xErrorStatus can be set outside of this function. This function just /* xErrorStatus can be set outside of this function. This function just
checks that all the tasks are still cycling. */ checks that all the tasks are still cycling. */
@ -669,17 +668,17 @@ static unsigned portBASE_TYPE uxLastHighPriorityLoops1 = 0, uxLastHighPriorityLo
/* The high priority 1 task has stalled. */ /* The high priority 1 task has stalled. */
prvQueueAccessLogError( __LINE__ ); prvQueueAccessLogError( __LINE__ );
} }
uxLastHighPriorityLoops1 = uxHighPriorityLoops1; uxLastHighPriorityLoops1 = uxHighPriorityLoops1;
if( uxHighPriorityLoops2 == uxLastHighPriorityLoops2 ) if( uxHighPriorityLoops2 == uxLastHighPriorityLoops2 )
{ {
/* The high priority 2 task has stalled. */ /* The high priority 2 task has stalled. */
prvQueueAccessLogError( __LINE__ ); prvQueueAccessLogError( __LINE__ );
} }
uxLastHighPriorityLoops2 = uxHighPriorityLoops2; uxLastHighPriorityLoops2 = uxHighPriorityLoops2;
if( uxLowPriorityLoops1 == uxLastLowPriorityLoops1 ) if( uxLowPriorityLoops1 == uxLastLowPriorityLoops1 )
{ {
/* The low priority 1 task has stalled. */ /* The low priority 1 task has stalled. */

Loading…
Cancel
Save