pic32/cores/pic32/HardwareSerial.cpp
/* ------------------------------------------------------------ */
/***	HardwareSerial::doSerialInt
**
**	Parameters:
**		none
**
**	Return Value:
**		none
**
**	Errors:
**		none
**
**	Description:
**		This function is called by the interrupt service routine
**		for the UART being used by this object. It's purpose is
**		to process receive interrupts and place the received
**		characters into the receive buffer.
*/


none

Return Value:
none

none

This function is called by the interrupt service routine
for the UART being used by this object. It's purpose is
to process receive interrupts and place the received
characters into the receive buffer.
none Return Value : none none This function is called by the interrupt service routine for the UART being used by this object . It ' s purpose is to process receive interrupts and place the received characters into the receive buffer .
void HardwareSerial::doSerialInt(void)
{
	int		bufIndex;
	uint8_t	ch;
	if ((ifs->reg & bit_rx) != 0)
	{
		ch = uart->uxRx.reg;
        if (rxIntr != NULL) {
            rxIntr(ch);
        } else {
            bufIndex	= (rx_buffer.head + 1) % RX_BUFFER_SIZE;
            if (bufIndex != rx_buffer.tail)
            {
                rx_buffer.buffer[rx_buffer.head] = ch;
                rx_buffer.head = bufIndex;
            }
        }
		ifs->clr = bit_rx;
	}
	if ((ifs->reg & bit_tx) != 0)
	{
		ifs->clr = bit_tx;
	}
}
void HardwareSerial :: doSerialInt ( void ) { int bufIndex ; uint8_t ch ; if ( ( ifs -> reg & bit_rx ) != 0 ) { ch = uart -> uxRx . reg ; if ( rxIntr != NULL ) { rxIntr ( ch ) ; } else { bufIndex = ( rx_buffer . head + 1 ) % RX_BUFFER_SIZE ; if ( bufIndex != rx_buffer . tail ) { rx_buffer . buffer [ rx_buffer . head ] = ch ; rx_buffer . head = bufIndex ; } } ifs -> clr = bit_rx ; } if ( ( ifs -> reg & bit_tx ) != 0 ) { ifs -> clr = bit_tx ; } }
HardwareSerial::doSerialInt
HardwareSerial :: doSerialInt
/* If it's a receive interrupt, get the character and store
	** it in the receive buffer.
	*/ /* If we have had an interrupt callback routine defined then call
            ** that instead of adding the character to the queue. Pass the
            ** received character to the function for processing.
            */ /* If we should be storing the received character into the location
            ** just before the tail (meaning that the head would advance to the
            ** current location of the tail), we're about to overflow the buffer
            ** and so we don't write the character or advance the head.
            */ /* Clear the interrupt flag.
		*/ /* If it's a transmit interrupt, ignore it, as we don't current
	** have interrupt driven i/o on the transmit side.
	*/ /* Clear the interrupt flag.
		*/