aboutsummaryrefslogtreecommitdiff
path: root/cores/arduino/HardwareSerial.h
diff options
context:
space:
mode:
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