From 14ec1adc380c3641bf4c20c6dca916793f71cc54 Mon Sep 17 00:00:00 2001 From: Travis Geiselbrecht Date: Tue, 22 May 2012 20:07:28 -0700 Subject: [PATCH] [sam] properly turn off usb code when USBCON is not defined --- hardware/arduino/sam/cores/arduino/USB/USBCore.cpp | 4 ++++ .../cores/arduino/validation_usb_device/test_usb_device.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/hardware/arduino/sam/cores/arduino/USB/USBCore.cpp b/hardware/arduino/sam/cores/arduino/USB/USBCore.cpp index 9b283d6d0..b06a88f93 100644 --- a/hardware/arduino/sam/cores/arduino/USB/USBCore.cpp +++ b/hardware/arduino/sam/cores/arduino/USB/USBCore.cpp @@ -1,3 +1,5 @@ +#ifdef USBCON + /* Copyright (c) 2010, Peter Barrett ** ** Permission to use, copy, modify, and/or distribute this software for @@ -587,3 +589,5 @@ bool USB_::configured() void USB_::poll() { } + +#endif // USBCON diff --git a/hardware/arduino/sam/cores/arduino/validation_usb_device/test_usb_device.cpp b/hardware/arduino/sam/cores/arduino/validation_usb_device/test_usb_device.cpp index ebb27d07b..1b8fab7d5 100644 --- a/hardware/arduino/sam/cores/arduino/validation_usb_device/test_usb_device.cpp +++ b/hardware/arduino/sam/cores/arduino/validation_usb_device/test_usb_device.cpp @@ -16,6 +16,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#if defined(USBCON) + #include "variant.h" #include @@ -36,3 +38,5 @@ void loop() { } delay(10); } + +#endif