voidHardwareSerial::_rx_complete_irq(void){if(bit_is_clear(*_ucsra,UPE0)){// No Parity error, read byte and store it in the buffer if there is
// room
unsignedcharc=*_udr;rx_buffer_index_ti=(unsignedint)(_rx_buffer_head+1)%SERIAL_RX_BUFFER_SIZE;// 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.
if(i!=_rx_buffer_tail){_rx_buffer[_rx_buffer_head]=c;_rx_buffer_head=i;}}else{// Parity error, read byte but discard it
*_udr;};}
if(bit_is_clear(*_ucsra,UPE0)){// No Parity error, read byte and store it in the buffer if there is
// room
unsignedcharc=*_udr;rx_buffer_index_ti=(unsignedint)(_rx_buffer_head+1)%SERIAL_RX_BUFFER_SIZE;// 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.
if(i!=_rx_buffer_tail){_rx_buffer[_rx_buffer_head]=c;_rx_buffer_head=i;}