pic32/cores/pic32/HardwareSerial.cpp
/* ------------------------------------------------------------ */
/***	HardwareSerial::peek
**
**	Parameters:
**		none
**
**	Return Value:
**		returns the next character from the receive buffer
**
**	Errors:
**		returns -1 if no characters in buffer
**
**	Description:
**		This returns the next character in the receive buffer without
**		removing it from the buffer, or -1 if no characters are in the buffer.
*/
:peek

none

Return Value:
returns the next character from the receive buffer

1 if no characters in buffer

This returns the next character in the receive buffer without
removing it from the buffer, or -1 if no characters are in the buffer.
: peek none Return Value : returns the next character from the receive buffer 1 if no characters in buffer This returns the next character in the receive buffer without removing it from the buffer or - 1 if no characters are in the buffer .
int HardwareSerial::peek()
{
	if (rx_buffer.head == rx_buffer.tail)
	{
		return -1;
	}
	else
	{
		return rx_buffer.buffer[rx_buffer.tail];
	}
}
int HardwareSerial :: peek ( ) { if ( rx_buffer . head == rx_buffer . tail ) { return -1 ; } else { return rx_buffer . buffer [ rx_buffer . tail ] ; } }
HardwareSerial::peek
HardwareSerial :: peek