base/serial.c
UCHAR* Serial_Read_Rx_Buffer()
{

   if(sqRxMessages.ucMessageCount > 0)
   {
      UCHAR i;
      //Copy the message content over to a buffer that we can return
      for(i = 0; i < SERIAL_QUEUE_BUFFER_LENGTH; i++)
         aucRxMessageBuffer[i] = sqRxMessages.aucMessages[sqRxMessages.ucTail].aucBuffer[i];
      //Release the message buffer so it can be used to store a new message
      sqRxMessages.ucTail = ((sqRxMessages.ucTail + 1) & (SERIAL_QUEUE_RX_SIZE-1));
      sqRxMessages.bQueueOverflow = FALSE;  //Set overflow flag
      sqRxMessages.ucMessageCount--;
      return aucRxMessageBuffer;
   }
   return(NULL);

}
////////////////////////////////////////////////////////////////////////////
// Serial_Read_Rx_Buffer
//
// Returns a pointer to any data in the QUEUE 
// 
////////////////////////////////////////////////////////////////////////////
Serial_Read_Rx_Buffer
Returns a pointer to any data in the QUEUE
Serial_Read_Rx_Buffer Returns a pointer to any data in the QUEUE
UCHAR* Serial_Read_Rx_Buffer()
{
   if(sqRxMessages.ucMessageCount > 0)
   {
      UCHAR i;
      for(i = 0; i < SERIAL_QUEUE_BUFFER_LENGTH; i++)
         aucRxMessageBuffer[i] = sqRxMessages.aucMessages[sqRxMessages.ucTail].aucBuffer[i];
      sqRxMessages.ucTail = ((sqRxMessages.ucTail + 1) & (SERIAL_QUEUE_RX_SIZE-1));
      sqRxMessages.bQueueOverflow = FALSE;  
      sqRxMessages.ucMessageCount--;
      return aucRxMessageBuffer;
   }
   return(NULL);
}
UCHAR * Serial_Read_Rx_Buffer ( ) { if ( sqRxMessages . ucMessageCount > 0 ) { UCHAR i ; for ( i = 0 ; i < SERIAL_QUEUE_BUFFER_LENGTH ; i ++ ) aucRxMessageBuffer [ i ] = sqRxMessages . aucMessages [ sqRxMessages . ucTail ] . aucBuffer [ i ] ; sqRxMessages . ucTail = ( ( sqRxMessages . ucTail + 1 ) & ( SERIAL_QUEUE_RX_SIZE - 1 ) ) ; sqRxMessages . bQueueOverflow = FALSE ; sqRxMessages . ucMessageCount -- ; return aucRxMessageBuffer ; } return ( NULL ) ; }
Serial_Read_Rx_Buffer
Returns a pointer to any data in the QUEUE
Serial_Read_Rx_Buffer Returns a pointer to any data in the QUEUE
//Copy the message content over to a buffer that we can return //Release the message buffer so it can be used to store a new message //Set overflow flag