Skip to content

Commit 462dab3

Browse files
committed
Merge pull request #1870 from matthijskooijman/ide-1.5.x-serial-int
In HardwareSerial::_rx_complete_irq, don't use int for buffer index
2 parents f4cd0ff + 45b5aa3 commit 462dab3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: cores/arduino/HardwareSerial_private.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ void HardwareSerial::_rx_complete_irq(void)
9999
// No Parity error, read byte and store it in the buffer if there is
100100
// room
101101
unsigned char c = *_udr;
102-
int i = (unsigned int)(_rx_buffer_head + 1) % SERIAL_BUFFER_SIZE;
102+
uint8_t i = (unsigned int)(_rx_buffer_head + 1) % SERIAL_BUFFER_SIZE;
103103

104104
// if we should be storing the received character into the location
105105
// just before the tail (meaning that the head would advance to the

0 commit comments

Comments
 (0)