firmware/Temperature/src/FIFO.c
////////////////////////////////////////////////////////
/// \brief Read one bute from the buffer. Return false
///	if we didn't.
///
///	\param outputDataPointer pointer to return the read value.
///
///	\return TRUE = successfully read a byte rom buffer
///			FALSE = no data to read
///			ERROR_INVALID_POINTER = Invalid outputDataPointer pointer
///
////////////////////////////////////////////////////////
\brief Read one bute from the buffer. Return false
if we didn't.

\param outputDataPointer pointer to return the read value.

\return TRUE = successfully read a byte rom buffer
FALSE = no data to read
ERROR_INVALID_POINTER = Invalid outputDataPointer pointer
\ brief Read one bute from the buffer . Return false if we didn ' t . \ param outputDataPointer pointer to return the read value . \ return TRUE = successfully read a byte rom buffer FALSE = no data to read ERROR_INVALID_POINTER = Invalid outputDataPointer pointer
uint_fast8_t FIFO_Read(uint8_t *outputDataPointer)
{
	uint_fast8_t Result = FALSE;
	if ( outputDataPointer )
	{
		if( BufferCurrentSize > 0)
		{
			*outputDataPointer = Buffer[ReadPosition];
			ReadPosition++;
			BufferCurrentSize--;
			if( ReadPosition == FIFO_BUFFER_MAX_SIZE )
			{
				ReadPosition = 0;
			}
			Result = TRUE;
		}
	}
	else
	{
		Result = ERROR_INVALID_POINTER;
	}
	return Result;
}
uint_fast8_t FIFO_Read ( uint8_t * outputDataPointer ) { uint_fast8_t Result = FALSE ; if ( outputDataPointer ) { if ( BufferCurrentSize > 0 ) { * outputDataPointer = Buffer [ ReadPosition ] ; ReadPosition ++ ; BufferCurrentSize -- ; if ( ReadPosition == FIFO_BUFFER_MAX_SIZE ) { ReadPosition = 0 ; } Result = TRUE ; } } else { Result = ERROR_INVALID_POINTER ; } return Result ; }
\brief Read one bute from the buffer.
\ brief Read one bute from the buffer .
// check pointer is valid and not set to zero // we have data to read // Pass the data back // pointer error