Index: firmware/App/Services/MsgQueues.c =================================================================== diff -u -ra0aca1a4d87df989303b4f7f41208a4916861afa -r1bbf9da32e622975efed00b1a7589387a9829440 --- firmware/App/Services/MsgQueues.c (.../MsgQueues.c) (revision a0aca1a4d87df989303b4f7f41208a4916861afa) +++ firmware/App/Services/MsgQueues.c (.../MsgQueues.c) (revision 1bbf9da32e622975efed00b1a7589387a9829440) @@ -26,10 +26,10 @@ // ********** private data ********** -static U32 msgQueueCounts[NUM_OF_MSG_QUEUES]; -static U32 msgQueueStarts[NUM_OF_MSG_QUEUES]; -static U32 msgQueueNexts[NUM_OF_MSG_QUEUES]; -static MESSAGE_WRAPPER_T msgQueues[NUM_OF_MSG_QUEUES][MAX_MSG_QUEUE_SIZE]; +static U32 msgQueueCounts[ NUM_OF_MSG_QUEUES ]; +static U32 msgQueueStarts[ NUM_OF_MSG_QUEUES ]; +static U32 msgQueueNexts[ NUM_OF_MSG_QUEUES ]; +static MESSAGE_WRAPPER_T msgQueues[ NUM_OF_MSG_QUEUES ][ MAX_MSG_QUEUE_SIZE ]; // ********** private function prototypes ********** @@ -49,12 +49,12 @@ // reset message queues for ( q = 0; q < NUM_OF_MSG_QUEUES; q++ ) { - msgQueueCounts[q] = 0; - msgQueueStarts[q] = 0; - msgQueueNexts[q] = 0; + msgQueueCounts[ q ] = 0; + msgQueueStarts[ q ] = 0; + msgQueueNexts[ q ] = 0; for ( m = 0; m < MAX_MSG_QUEUE_SIZE; m++ ) { - blankMessageInWrapper( &msgQueues[q][m] ); + blankMessageInWrapper( &msgQueues[ q ][ m ] ); } } } @@ -81,11 +81,11 @@ { result = TRUE; // add message to queue - msgQueues[queue][msgQueueNexts[queue]] = *msg; + msgQueues[ queue ][ msgQueueNexts[ queue ] ] = *msg; // increment next index to add to - msgQueueNexts[queue] = INC_WRAP(msgQueueNexts[queue],0,MAX_MSG_QUEUE_SIZE-1); + msgQueueNexts[ queue ] = INC_WRAP( msgQueueNexts[ queue ], 0, MAX_MSG_QUEUE_SIZE - 1 ); // increment queue count - msgQueueCounts[queue]++; + msgQueueCounts[ queue ]++; } else // msg queue is full { @@ -123,11 +123,11 @@ { result = TRUE; // get message from queue - *msg = msgQueues[queue][msgQueueStarts[queue]]; + *msg = msgQueues[ queue ][ msgQueueStarts[ queue ] ]; // increment queue next index to get from - msgQueueStarts[queue] = INC_WRAP(msgQueueStarts[queue],0,MAX_MSG_QUEUE_SIZE-1); + msgQueueStarts[ queue ] = INC_WRAP( msgQueueStarts[ queue ], 0, MAX_MSG_QUEUE_SIZE - 1 ); // decrement queue count - msgQueueCounts[queue]--; + msgQueueCounts[ queue ]--; } else // message queue is empty { @@ -158,7 +158,7 @@ // verify given message queue if ( queue < NUM_OF_MSG_QUEUES ) { - if ( msgQueueCounts[queue] == 0 ) + if ( msgQueueCounts[ queue ] == 0 ) { result = TRUE; } @@ -187,7 +187,7 @@ // verify given message queue if ( queue < NUM_OF_MSG_QUEUES ) { - if ( msgQueueCounts[queue] < MAX_MSG_QUEUE_SIZE ) + if ( msgQueueCounts[ queue ] < MAX_MSG_QUEUE_SIZE ) { result = FALSE; }