mirror of
https://github.com/esp8266/Arduino.git
synced 2025-08-05 13:16:13 +03:00
removed conditional compilation checks for CDC_ENABLED
bootloader must always have CDC enabled
This commit is contained in:
@@ -21,7 +21,6 @@
|
|||||||
#include <avr/wdt.h>
|
#include <avr/wdt.h>
|
||||||
|
|
||||||
#if defined(USBCON)
|
#if defined(USBCON)
|
||||||
#ifdef CDC_ENABLED
|
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
@@ -91,6 +90,4 @@ bool WEAK CDC_Setup(Setup& setup)
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
#endif /* if defined(USBCON) */
|
||||||
#endif
|
|
||||||
#endif /* if defined(USBCON) */
|
|
||||||
|
@@ -25,8 +25,6 @@ typedef unsigned char u8;
|
|||||||
typedef unsigned short u16;
|
typedef unsigned short u16;
|
||||||
typedef unsigned long u32;
|
typedef unsigned long u32;
|
||||||
|
|
||||||
#define CDC_ENABLED
|
|
||||||
|
|
||||||
#define USB_PID_LEONARDO 0x0034
|
#define USB_PID_LEONARDO 0x0034
|
||||||
#define USB_PID_MICRO 0x0035
|
#define USB_PID_MICRO 0x0035
|
||||||
#define USB_VID 0x2341 // arduino LLC vid
|
#define USB_VID 0x2341 // arduino LLC vid
|
||||||
|
@@ -62,11 +62,7 @@ const u16 STRING_IMANUFACTURER[12] = {
|
|||||||
'A','r','d','u','i','n','o',' ','L','L','C'
|
'A','r','d','u','i','n','o',' ','L','L','C'
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef CDC_ENABLED
|
|
||||||
#define DEVICE_CLASS 0x02
|
#define DEVICE_CLASS 0x02
|
||||||
#else
|
|
||||||
#define DEVICE_CLASS 0x00
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// DEVICE DESCRIPTOR
|
// DEVICE DESCRIPTOR
|
||||||
const DeviceDescriptor USB_DeviceDescriptor =
|
const DeviceDescriptor USB_DeviceDescriptor =
|
||||||
@@ -320,12 +316,9 @@ extern const u8 _initEndpoints[] PROGMEM;
|
|||||||
const u8 _initEndpoints[] =
|
const u8 _initEndpoints[] =
|
||||||
{
|
{
|
||||||
0,
|
0,
|
||||||
|
|
||||||
#ifdef CDC_ENABLED
|
|
||||||
EP_TYPE_INTERRUPT_IN, // CDC_ENDPOINT_ACM
|
EP_TYPE_INTERRUPT_IN, // CDC_ENDPOINT_ACM
|
||||||
EP_TYPE_BULK_OUT, // CDC_ENDPOINT_OUT
|
EP_TYPE_BULK_OUT, // CDC_ENDPOINT_OUT
|
||||||
EP_TYPE_BULK_IN, // CDC_ENDPOINT_IN
|
EP_TYPE_BULK_IN, // CDC_ENDPOINT_IN
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#define EP_SINGLE_64 0x32 // EP0
|
#define EP_SINGLE_64 0x32 // EP0
|
||||||
@@ -360,10 +353,8 @@ bool ClassInterfaceRequest(Setup& setup)
|
|||||||
{
|
{
|
||||||
u8 i = setup.wIndex;
|
u8 i = setup.wIndex;
|
||||||
|
|
||||||
#ifdef CDC_ENABLED
|
|
||||||
if (CDC_ACM_INTERFACE == i)
|
if (CDC_ACM_INTERFACE == i)
|
||||||
return CDC_Setup(setup);
|
return CDC_Setup(setup);
|
||||||
#endif
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -422,11 +413,7 @@ int SendInterfaces()
|
|||||||
{
|
{
|
||||||
int total = 0;
|
int total = 0;
|
||||||
u8 interfaces = 0;
|
u8 interfaces = 0;
|
||||||
|
|
||||||
#ifdef CDC_ENABLED
|
|
||||||
total = CDC_GetInterface(&interfaces);
|
total = CDC_GetInterface(&interfaces);
|
||||||
#endif
|
|
||||||
|
|
||||||
return interfaces;
|
return interfaces;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -16,15 +16,8 @@
|
|||||||
** SOFTWARE.
|
** SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define CDC_ENABLED
|
|
||||||
|
|
||||||
#ifdef CDC_ENABLED
|
|
||||||
#define CDC_INTERFACE_COUNT 2
|
#define CDC_INTERFACE_COUNT 2
|
||||||
#define CDC_ENPOINT_COUNT 3
|
#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_ACM_INTERFACE 0 // CDC ACM
|
||||||
#define CDC_DATA_INTERFACE 1 // CDC Data
|
#define CDC_DATA_INTERFACE 1 // CDC Data
|
||||||
@@ -33,10 +26,8 @@
|
|||||||
#define CDC_ENDPOINT_OUT (CDC_FIRST_ENDPOINT+1)
|
#define CDC_ENDPOINT_OUT (CDC_FIRST_ENDPOINT+1)
|
||||||
#define CDC_ENDPOINT_IN (CDC_FIRST_ENDPOINT+2)
|
#define CDC_ENDPOINT_IN (CDC_FIRST_ENDPOINT+2)
|
||||||
|
|
||||||
#ifdef CDC_ENABLED
|
|
||||||
#define CDC_RX CDC_ENDPOINT_OUT
|
#define CDC_RX CDC_ENDPOINT_OUT
|
||||||
#define CDC_TX CDC_ENDPOINT_IN
|
#define CDC_TX CDC_ENDPOINT_IN
|
||||||
#endif
|
|
||||||
|
|
||||||
#define IMANUFACTURER 1
|
#define IMANUFACTURER 1
|
||||||
#define IPRODUCT 2
|
#define IPRODUCT 2
|
||||||
|
Reference in New Issue
Block a user