Permalink
Browse files

make CDC function non removable

  • Loading branch information...
facchinm authored and cmaglie committed Jun 8, 2015
1 parent 018fb96 commit 91ccab4f09dedd789a81eaa7f3c7bf3028e906f5
@@ -20,7 +20,6 @@
#include <avr/wdt.h>
#if defined(USBCON)
-#ifdef CDC_ENABLED
typedef struct
{
@@ -207,5 +206,4 @@ Serial_::operator bool() {
Serial_ Serial;
-#endif
#endif /* if defined(USBCON) */
@@ -66,11 +66,7 @@ const u8 STRING_PRODUCT[] PROGMEM = USB_PRODUCT;
const u8 STRING_MANUFACTURER[] PROGMEM = USB_MANUFACTURER;
-#ifdef CDC_ENABLED
#define DEVICE_CLASS 0x02
-#else
-#define DEVICE_CLASS 0x00
-#endif
// DEVICE DESCRIPTOR
const DeviceDescriptor USB_DeviceDescriptor =
@@ -318,11 +314,9 @@ 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
#ifdef PLUGGABLE_USB_ENABLED
//allocate 6 endpoints and remove const so they can be changed by the user
@@ -367,10 +361,8 @@ bool ClassInterfaceRequest(Setup& setup)
{
u8 i = setup.wIndex;
-#ifdef CDC_ENABLED
if (CDC_ACM_INTERFACE == i)
return CDC_Setup(setup);
-#endif
#ifdef PLUGGABLE_USB_ENABLED
return PUSB_Setup(setup, i);
@@ -448,9 +440,7 @@ int SendInterfaces()
{
u8 interfaces = 0;
-#ifdef CDC_ENABLED
CDC_GetInterface(&interfaces);
-#endif
#ifdef PLUGGABLE_USB_ENABLED
PUSB_GetInterface(&interfaces);
@@ -629,9 +619,7 @@ ISR(USB_GEN_vect)
// Start of Frame - happens every millisecond so we use it for TX and RX LED one-shot timing, too
if (udint & (1<<SOFI))
{
-#ifdef CDC_ENABLED
USB_Flush(CDC_TX); // Send a tx frame if found
-#endif
// check whether the one-shot period has elapsed. if so, turn off the LED
if (TxLEDPulse && !(--TxLEDPulse))
@@ -16,17 +16,11 @@
** SOFTWARE.
*/
-#define CDC_ENABLED
#define PLUGGABLE_USB_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
@@ -37,10 +31,8 @@
#define INTERFACE_COUNT (MSC_INTERFACE + MSC_INTERFACE_COUNT)
-#ifdef CDC_ENABLED
#define CDC_RX CDC_ENDPOINT_OUT
#define CDC_TX CDC_ENDPOINT_IN
-#endif
#define IMANUFACTURER 1
#define IPRODUCT 2

0 comments on commit 91ccab4

Please sign in to comment.