aboutsummaryrefslogtreecommitdiff
path: root/cores/arduino
diff options
context:
space:
mode:
authorZach Eveland <zeveland@blacklabel-development.com>2011-08-30 11:50:08 -0400
committerZach Eveland <zeveland@blacklabel-development.com>2011-08-30 11:50:08 -0400
commitaf635024db2b5d46d57eb5f5da959f6b4f4bf42c (patch)
tree37c2727e05642c2ed5ca2b9267adbf2d6fde70ce /cores/arduino
parent481fdeab797d449f6b82473b1e377c495224cff7 (diff)
support for non-Leonardo boards is back!
Diffstat (limited to 'cores/arduino')
-rw-r--r--cores/arduino/CDC.cpp2
-rw-r--r--cores/arduino/HID.cpp5
-rw-r--r--cores/arduino/Platform.h8
-rw-r--r--cores/arduino/USBAPI.h6
-rw-r--r--cores/arduino/USBCore.cpp6
5 files changed, 21 insertions, 6 deletions
diff --git a/cores/arduino/CDC.cpp b/cores/arduino/CDC.cpp
index 1f1fcb5..b229cb5 100644
--- a/cores/arduino/CDC.cpp
+++ b/cores/arduino/CDC.cpp
@@ -20,6 +20,7 @@
#include "USBAPI.h"
#include <avr/wdt.h>
+#if defined(USBCON)
#ifdef CDC_ENABLED
// TODO: Should really use the wdt here
@@ -174,3 +175,4 @@ size_t Serial_::write(uint8_t c)
Serial_ Serial;
#endif
+#endif /* if defined(USBCON) */ \ No newline at end of file
diff --git a/cores/arduino/HID.cpp b/cores/arduino/HID.cpp
index 36e9b67..cea90fc 100644
--- a/cores/arduino/HID.cpp
+++ b/cores/arduino/HID.cpp
@@ -20,6 +20,7 @@
#include "USBAPI.h"
#include "USBDesc.h"
+#if defined(USBCON)
#ifdef HID_ENABLED
//#define RAWHID_ENABLED
@@ -419,4 +420,6 @@ size_t Keyboard_::write(uint8_t c)
return 1;
}
-#endif \ No newline at end of file
+#endif
+
+#endif /* if defined(USBCON) */ \ No newline at end of file
diff --git a/cores/arduino/Platform.h b/cores/arduino/Platform.h
index 6a1f340..8b8f742 100644
--- a/cores/arduino/Platform.h
+++ b/cores/arduino/Platform.h
@@ -14,8 +14,10 @@ typedef unsigned long u32;
#include "Arduino.h"
-#include "USBDesc.h"
-#include "USBCore.h"
-#include "USBAPI.h"
+#if defined(USBCON)
+ #include "USBDesc.h"
+ #include "USBCore.h"
+ #include "USBAPI.h"
+#endif /* if defined(USBCON) */
#endif
diff --git a/cores/arduino/USBAPI.h b/cores/arduino/USBAPI.h
index b833009..0dad176 100644
--- a/cores/arduino/USBAPI.h
+++ b/cores/arduino/USBAPI.h
@@ -3,6 +3,8 @@
#ifndef __USBAPI__
#define __USBAPI__
+#if defined(USBCON)
+
//================================================================================
//================================================================================
// USB
@@ -153,4 +155,6 @@ int USB_Recv(uint8_t ep, void* data, int len); // non-blocking
int USB_Recv(uint8_t ep); // non-blocking
void USB_Flush(uint8_t ep);
-#endif \ No newline at end of file
+#endif
+
+#endif /* if defined(USBCON) */ \ No newline at end of file
diff --git a/cores/arduino/USBCore.cpp b/cores/arduino/USBCore.cpp
index 49fda35..9ce2e00 100644
--- a/cores/arduino/USBCore.cpp
+++ b/cores/arduino/USBCore.cpp
@@ -20,6 +20,8 @@
#include "USBAPI.h"
#include "USBDesc.h"
+#if defined(USBCON)
+
#define EP_TYPE_CONTROL 0x00
#define EP_TYPE_BULK_IN 0x81
#define EP_TYPE_BULK_OUT 0x80
@@ -648,4 +650,6 @@ void USB_::poll()
if (USB_Available(MSC_RX))
MSC_Data(MSC_RX,MSC_TX);
#endif
-} \ No newline at end of file
+}
+
+#endif /* if defined(USBCON) */ \ No newline at end of file