[gnoduino: 195/237] removed conditional compilation checks for CDC_ENABLED



commit 92eec633eed4252f3f335227caeff739ea0290af
Author: Zach Eveland <zeveland blacklabel-development com>
Date:   Thu Oct 27 10:48:26 2011 -0400

    removed conditional compilation checks for CDC_ENABLED
    
    bootloader must always have CDC enabled

 arduino/bootloaders/diskloader/src/CDC.cpp     |    5 +----
 arduino/bootloaders/diskloader/src/Platform.h  |    2 --
 arduino/bootloaders/diskloader/src/USBCore.cpp |   13 -------------
 arduino/bootloaders/diskloader/src/USBDesc.h   |    9 ---------
 4 files changed, 1 insertions(+), 28 deletions(-)
---
diff --git a/arduino/bootloaders/diskloader/src/CDC.cpp b/arduino/bootloaders/diskloader/src/CDC.cpp
index a542d3c..4496a9c 100644
--- a/arduino/bootloaders/diskloader/src/CDC.cpp
+++ b/arduino/bootloaders/diskloader/src/CDC.cpp
@@ -21,7 +21,6 @@
 #include <avr/wdt.h>
 
 #if defined(USBCON)
-#ifdef CDC_ENABLED
 
 typedef struct
 {
@@ -91,6 +90,4 @@ bool WEAK CDC_Setup(Setup& setup)
 	}
 	return false;
 }
-
-#endif
-#endif /* if defined(USBCON) */
\ No newline at end of file
+#endif /* if defined(USBCON) */
diff --git a/arduino/bootloaders/diskloader/src/Platform.h b/arduino/bootloaders/diskloader/src/Platform.h
index 9416c47..f1194a5 100644
--- a/arduino/bootloaders/diskloader/src/Platform.h
+++ b/arduino/bootloaders/diskloader/src/Platform.h
@@ -25,8 +25,6 @@ typedef unsigned char u8;
 typedef unsigned short u16;
 typedef unsigned long u32;
 
-#define CDC_ENABLED
-
 #define USB_PID_LEONARDO 0x0034
 #define USB_PID_MICRO 0x0035
 #define USB_VID 0x2341	// arduino LLC vid
diff --git a/arduino/bootloaders/diskloader/src/USBCore.cpp b/arduino/bootloaders/diskloader/src/USBCore.cpp
index 4771181..6518ae9 100644
--- a/arduino/bootloaders/diskloader/src/USBCore.cpp
+++ b/arduino/bootloaders/diskloader/src/USBCore.cpp
@@ -62,11 +62,7 @@ const u16 STRING_IMANUFACTURER[12] = {
 	'A','r','d','u','i','n','o',' ','L','L','C'
 };
 
-#ifdef CDC_ENABLED
 #define DEVICE_CLASS 0x02
-#else
-#define DEVICE_CLASS 0x00
-#endif
 
 //	DEVICE DESCRIPTOR
 const DeviceDescriptor USB_DeviceDescriptor =
@@ -320,12 +316,9 @@ extern const u8 _initEndpoints[] PROGMEM;
 const u8 _initEndpoints[] = 
 {
 	0,
-	
-#ifdef CDC_ENABLED
 	EP_TYPE_INTERRUPT_IN,		// CDC_ENDPOINT_ACM
 	EP_TYPE_BULK_OUT,			// CDC_ENDPOINT_OUT
 	EP_TYPE_BULK_IN,			// CDC_ENDPOINT_IN
-#endif
 };
 
 #define EP_SINGLE_64 0x32	// EP0
@@ -360,10 +353,8 @@ bool ClassInterfaceRequest(Setup& setup)
 {
 	u8 i = setup.wIndex;
 
-#ifdef CDC_ENABLED
 	if (CDC_ACM_INTERFACE == i)
 		return CDC_Setup(setup);
-#endif
 
 	return false;
 }
@@ -422,11 +413,7 @@ int SendInterfaces()
 {
 	int total = 0;
 	u8 interfaces = 0;
-
-#ifdef CDC_ENABLED
 	total = CDC_GetInterface(&interfaces);
-#endif
-
 	return interfaces;
 }
 
diff --git a/arduino/bootloaders/diskloader/src/USBDesc.h b/arduino/bootloaders/diskloader/src/USBDesc.h
index 997ff61..588a40c 100644
--- a/arduino/bootloaders/diskloader/src/USBDesc.h
+++ b/arduino/bootloaders/diskloader/src/USBDesc.h
@@ -16,15 +16,8 @@
 ** SOFTWARE.  
 */
 
-#define CDC_ENABLED
-
-#ifdef CDC_ENABLED
 #define CDC_INTERFACE_COUNT	2
 #define CDC_ENPOINT_COUNT	3
-#else
-#define CDC_INTERFACE_COUNT	0
-#define CDC_ENPOINT_COUNT	0
-#endif
 
 #define CDC_ACM_INTERFACE	0	// CDC ACM
 #define CDC_DATA_INTERFACE	1	// CDC Data
@@ -33,10 +26,8 @@
 #define CDC_ENDPOINT_OUT	(CDC_FIRST_ENDPOINT+1)
 #define CDC_ENDPOINT_IN		(CDC_FIRST_ENDPOINT+2)
 
-#ifdef CDC_ENABLED
 #define CDC_RX CDC_ENDPOINT_OUT
 #define CDC_TX CDC_ENDPOINT_IN
-#endif
 
 #define IMANUFACTURER	1
 #define IPRODUCT		2



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]