We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 8504bca + 6372eb8 commit 92958efCopy full SHA for 92958ef
hardware/arduino/avr/cores/arduino/HardwareSerial.cpp
@@ -171,7 +171,7 @@ int HardwareSerial::read(void)
171
return -1;
172
} else {
173
unsigned char c = _rx_buffer[_rx_buffer_tail];
174
- _rx_buffer_tail = (unsigned int)(_rx_buffer_tail + 1) % SERIAL_BUFFER_SIZE;
+ _rx_buffer_tail = (uint8_t)(_rx_buffer_tail + 1) % SERIAL_BUFFER_SIZE;
175
return c;
176
}
177
@@ -207,7 +207,7 @@ size_t HardwareSerial::write(uint8_t c)
207
sbi(*_ucsra, TXC0);
208
return 1;
209
210
- int i = (_tx_buffer_head + 1) % SERIAL_BUFFER_SIZE;
+ uint8_t i = (_tx_buffer_head + 1) % SERIAL_BUFFER_SIZE;
211
212
// If the output buffer is full, there's nothing for it other than to
213
// wait for the interrupt handler to empty it a bit
0 commit comments