1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-17 22:23:10 +03:00

Merge pull request #1870 from matthijskooijman/ide-1.5.x-serial-int

In HardwareSerial::_rx_complete_irq, don't use int for buffer index
This commit is contained in:
Cristian Maglie
2014-02-18 22:43:16 +01:00

View File

@ -99,7 +99,7 @@ void HardwareSerial::_rx_complete_irq(void)
// No Parity error, read byte and store it in the buffer if there is // No Parity error, read byte and store it in the buffer if there is
// room // room
unsigned char c = *_udr; unsigned char c = *_udr;
int i = (unsigned int)(_rx_buffer_head + 1) % SERIAL_BUFFER_SIZE; uint8_t i = (unsigned int)(_rx_buffer_head + 1) % SERIAL_BUFFER_SIZE;
// if we should be storing the received character into the location // if we should be storing the received character into the location
// just before the tail (meaning that the head would advance to the // just before the tail (meaning that the head would advance to the