diff options
author | Matthijs Kooijman <matthijs@stdin.nl> | 2014-06-25 17:16:53 +0200 |
---|---|---|
committer | Matthijs Kooijman <matthijs@stdin.nl> | 2014-06-25 17:20:07 +0200 |
commit | 0d40e5cace584c560091aea960f58cb1dc5a0dd9 (patch) | |
tree | b0d386d6ba750a6cf7da219e34495ad9905d2bdb /cores/arduino/HardwareSerial_private.h | |
parent | 55000f4b720984aba2df378cacbf65357c803f26 (diff) |
Support Atmega8 (and similar that define PE instead of UPE) again
These chips were previously supported, but since parity error checking
was added, this support has broken. Most chips define UPE0 (etc.) for
the parity error bit. Some chips don't have numbered UARTS so only
define UPE and even fewer define PE instead of UPE. This adds support
for those chips again.
Closes: #2137
Diffstat (limited to 'cores/arduino/HardwareSerial_private.h')
-rw-r--r-- | cores/arduino/HardwareSerial_private.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/cores/arduino/HardwareSerial_private.h b/cores/arduino/HardwareSerial_private.h index ea41028..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 |