aboutsummaryrefslogtreecommitdiff
path: root/cores/arduino/HardwareSerial_private.h
diff options
context:
space:
mode:
Diffstat (limited to 'cores/arduino/HardwareSerial_private.h')
-rw-r--r--cores/arduino/HardwareSerial_private.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/cores/arduino/HardwareSerial_private.h b/cores/arduino/HardwareSerial_private.h
index 915d7a1..761a5e5 100644
--- a/cores/arduino/HardwareSerial_private.h
+++ b/cores/arduino/HardwareSerial_private.h
@@ -34,6 +34,11 @@
// slower.
#if !defined(TXC0)
#if defined(TXC)
+// Some chips like ATmega8 don't have UPE, only PE. The other bits are
+// named as expected.
+#if !defined(UPE) && defined(PE)
+#define UPE PE
+#endif
// On ATmega8, the uart and its bits are not numbered, so there is no TXC0 etc.
#define TXC0 TXC
#define RXEN0 RXEN
@@ -99,7 +104,7 @@ void HardwareSerial::_rx_complete_irq(void)
// No Parity error, read byte and store it in the buffer if there is
// room
unsigned char c = *_udr;
- int i = (unsigned int)(_rx_buffer_head + 1) % SERIAL_BUFFER_SIZE;
+ rx_buffer_index_t i = (unsigned int)(_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