From 940145ca6d112782020c8570070c14ba57fdec20 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Wed, 6 Jun 2012 19:39:38 +0000 Subject: [PATCH] Fix errors in the SingleUSBModeTest build test. Fix logic errors in USBMode.h. --- BuildTests/SingleUSBModeTest/Dummy.S | 3 ++- BuildTests/SingleUSBModeTest/makefile | 10 +++++----- LUFA/Drivers/USB/Core/USBMode.h | 12 +++++++----- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/BuildTests/SingleUSBModeTest/Dummy.S b/BuildTests/SingleUSBModeTest/Dummy.S index bc13b31eb1..5ed1b4a245 100644 --- a/BuildTests/SingleUSBModeTest/Dummy.S +++ b/BuildTests/SingleUSBModeTest/Dummy.S @@ -34,7 +34,8 @@ # Mandatory entry point for successful compilation and link .global main main: - + # Force code generation of the base USB stack + call USB_Init # Mandatory callback needed for base compile of the USB driver .global CALLBACK_USB_GetDescriptor diff --git a/BuildTests/SingleUSBModeTest/makefile b/BuildTests/SingleUSBModeTest/makefile index 56231c06ab..53bdbe0d51 100644 --- a/BuildTests/SingleUSBModeTest/makefile +++ b/BuildTests/SingleUSBModeTest/makefile @@ -25,13 +25,13 @@ end: @echo compile: - $(MAKE) -s -f makefile.test clean elf ARCH=AVR8 MCU=at90usb1287 CCFLAGS='-D USB_DEVICE_ONLY' - $(MAKE) -s -f makefile.test clean elf ARCH=AVR8 MCU=at90usb1287 CCFLAGS='-D USB_HOST_ONLY' + $(MAKE) -s -f makefile.test clean elf ARCH=AVR8 MCU=at90usb1287 CC_FLAGS='-D USB_DEVICE_ONLY' + $(MAKE) -s -f makefile.test clean elf ARCH=AVR8 MCU=at90usb1287 CC_FLAGS='-D USB_HOST_ONLY' - $(MAKE) -s -f makefile.test clean elf ARCH=XMEGA MCU=atxmega128a1u CCFLAGS='-D USB_DEVICE_ONLY' + $(MAKE) -s -f makefile.test clean elf ARCH=XMEGA MCU=atxmega128a1u CC_FLAGS='-D USB_DEVICE_ONLY' - $(MAKE) -s -f makefile.test clean elf ARCH=UC3 MCU=uc3a0256 CCFLAGS='-D USB_DEVICE_ONLY' - $(MAKE) -s -f makefile.test clean elf ARCH=UC3 MCU=uc3a0256 CCFLAGS='-D USB_HOST_ONLY' + $(MAKE) -s -f makefile.test clean elf ARCH=UC3 MCU=uc3a0256 CC_FLAGS='-D USB_DEVICE_ONLY' + $(MAKE) -s -f makefile.test clean elf ARCH=UC3 MCU=uc3a0256 CC_FLAGS='-D USB_HOST_ONLY' clean: $(MAKE) -s -f makefile.test clean ARCH=AVR8 MCU=at90usb1287 diff --git a/LUFA/Drivers/USB/Core/USBMode.h b/LUFA/Drivers/USB/Core/USBMode.h index 02c4ec3218..1b1d9dc9ae 100644 --- a/LUFA/Drivers/USB/Core/USBMode.h +++ b/LUFA/Drivers/USB/Core/USBMode.h @@ -239,12 +239,14 @@ #define USB_CAN_BE_DEVICE #endif - #if ( defined(USB_CAN_BE_DEVICE) && defined(USB_CAN_BE_HOST)) - #define USB_CAN_BE_BOTH - #elif ( defined(USB_CAN_BE_DEVICE) && !defined(USB_CAN_BE_HOST)) - #define USB_DEVICE_ONLY + #if ( defined(USB_CAN_BE_DEVICE) && !defined(USB_CAN_BE_HOST)) + #if !defined(USB_DEVICE_ONLY) + #define USB_DEVICE_ONLY + #endif #elif (!defined(USB_CAN_BE_DEVICE) && defined(USB_CAN_BE_HOST)) - #define USB_HOST_ONLY + #if !defined(USB_HOST_ONLY) + #define USB_HOST_ONLY + #endif #endif #if defined(USB_HOST_ONLY)