Skip to content

Commit 0617fab

Browse files
committed
removed conditional compilation checks for CDC_ENABLED
bootloader must always have CDC enabled
1 parent 2b70d99 commit 0617fab

File tree

4 files changed

+1
-28
lines changed

4 files changed

+1
-28
lines changed

bootloaders/diskloader/src/CDC.cpp

+1-4
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include <avr/wdt.h>
2222

2323
#if defined(USBCON)
24-
#ifdef CDC_ENABLED
2524

2625
typedef struct
2726
{
@@ -91,6 +90,4 @@ bool WEAK CDC_Setup(Setup& setup)
9190
}
9291
return false;
9392
}
94-
95-
#endif
96-
#endif /* if defined(USBCON) */
93+
#endif /* if defined(USBCON) */

bootloaders/diskloader/src/Platform.h

-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ typedef unsigned char u8;
2525
typedef unsigned short u16;
2626
typedef unsigned long u32;
2727

28-
#define CDC_ENABLED
29-
3028
#define USB_PID_LEONARDO 0x0034
3129
#define USB_PID_MICRO 0x0035
3230
#define USB_VID 0x2341 // arduino LLC vid

bootloaders/diskloader/src/USBCore.cpp

-13
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,7 @@ const u16 STRING_IMANUFACTURER[12] = {
6262
'A','r','d','u','i','n','o',' ','L','L','C'
6363
};
6464

65-
#ifdef CDC_ENABLED
6665
#define DEVICE_CLASS 0x02
67-
#else
68-
#define DEVICE_CLASS 0x00
69-
#endif
7066

7167
// DEVICE DESCRIPTOR
7268
const DeviceDescriptor USB_DeviceDescriptor =
@@ -320,12 +316,9 @@ extern const u8 _initEndpoints[] PROGMEM;
320316
const u8 _initEndpoints[] =
321317
{
322318
0,
323-
324-
#ifdef CDC_ENABLED
325319
EP_TYPE_INTERRUPT_IN, // CDC_ENDPOINT_ACM
326320
EP_TYPE_BULK_OUT, // CDC_ENDPOINT_OUT
327321
EP_TYPE_BULK_IN, // CDC_ENDPOINT_IN
328-
#endif
329322
};
330323

331324
#define EP_SINGLE_64 0x32 // EP0
@@ -360,10 +353,8 @@ bool ClassInterfaceRequest(Setup& setup)
360353
{
361354
u8 i = setup.wIndex;
362355

363-
#ifdef CDC_ENABLED
364356
if (CDC_ACM_INTERFACE == i)
365357
return CDC_Setup(setup);
366-
#endif
367358

368359
return false;
369360
}
@@ -422,11 +413,7 @@ int SendInterfaces()
422413
{
423414
int total = 0;
424415
u8 interfaces = 0;
425-
426-
#ifdef CDC_ENABLED
427416
total = CDC_GetInterface(&interfaces);
428-
#endif
429-
430417
return interfaces;
431418
}
432419

bootloaders/diskloader/src/USBDesc.h

-9
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,8 @@
1616
** SOFTWARE.
1717
*/
1818

19-
#define CDC_ENABLED
20-
21-
#ifdef CDC_ENABLED
2219
#define CDC_INTERFACE_COUNT 2
2320
#define CDC_ENPOINT_COUNT 3
24-
#else
25-
#define CDC_INTERFACE_COUNT 0
26-
#define CDC_ENPOINT_COUNT 0
27-
#endif
2821

2922
#define CDC_ACM_INTERFACE 0 // CDC ACM
3023
#define CDC_DATA_INTERFACE 1 // CDC Data
@@ -33,10 +26,8 @@
3326
#define CDC_ENDPOINT_OUT (CDC_FIRST_ENDPOINT+1)
3427
#define CDC_ENDPOINT_IN (CDC_FIRST_ENDPOINT+2)
3528

36-
#ifdef CDC_ENABLED
3729
#define CDC_RX CDC_ENDPOINT_OUT
3830
#define CDC_TX CDC_ENDPOINT_IN
39-
#endif
4031

4132
#define IMANUFACTURER 1
4233
#define IPRODUCT 2

0 commit comments

Comments
 (0)