aboutsummaryrefslogtreecommitdiff
path: root/cores/arduino/HardwareSerial.h
diff options
context:
space:
mode:
authorDavid A. Mellis <d.mellis@arduino.cc>2010-10-17 13:36:02 -0400
committerDavid A. Mellis <d.mellis@arduino.cc>2010-10-17 13:36:02 -0400
commit8b09b6be80680cfbc614ab387715a8a8021b2818 (patch)
treec9273d465b6d3082a73ce882ea2ff2ae988f3ba9 /cores/arduino/HardwareSerial.h
parent152a913571c439f907b57e9d67c3566fe62d22ee (diff)
Making HardwareSerial tests register-based, not CPU-based.
Mark Sproul's patches, via Christian Maglie. http://code.google.com/p/arduino/issues/detail?id=315
Diffstat (limited to 'cores/arduino/HardwareSerial.h')
-rw-r--r--[-rwxr-xr-x]cores/arduino/HardwareSerial.h21
1 files changed, 15 insertions, 6 deletions
diff --git a/cores/arduino/HardwareSerial.h b/cores/arduino/HardwareSerial.h
index 29898b9..3efa775 100755..100644
--- a/cores/arduino/HardwareSerial.h
+++ b/cores/arduino/HardwareSerial.h
@@ -15,6 +15,8 @@
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ Modified 28 September 2010 by Mark Sproul
*/
#ifndef HardwareSerial_h
@@ -56,12 +58,19 @@ class HardwareSerial : public Stream
using Print::write; // pull in write(str) and write(buf, size) from Print
};
-extern HardwareSerial Serial;
-
-#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
-extern HardwareSerial Serial1;
-extern HardwareSerial Serial2;
-extern HardwareSerial Serial3;
+#if defined(UBRRH) || defined(UBRR0H)
+ extern HardwareSerial Serial;
+#elif defined(USBCON)
+ #include "usb_api.h"
+#endif
+#if defined(UBRR1H)
+ extern HardwareSerial Serial1;
+#endif
+#if defined(UBRR2H)
+ extern HardwareSerial Serial2;
+#endif
+#if defined(UBRR3H)
+ extern HardwareSerial Serial3;
#endif
#endif