Skip to content

Commit 43701fd

Browse files
committed
make CDC function non removable
1 parent 790cf7d commit 43701fd

File tree

3 files changed

+0
-22
lines changed

3 files changed

+0
-22
lines changed

Diff for: hardware/arduino/avr/cores/arduino/CDC.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include <avr/wdt.h>
2121

2222
#if defined(USBCON)
23-
#ifdef CDC_ENABLED
2423

2524
typedef struct
2625
{
@@ -207,5 +206,4 @@ Serial_::operator bool() {
207206

208207
Serial_ Serial;
209208

210-
#endif
211209
#endif /* if defined(USBCON) */

Diff for: hardware/arduino/avr/cores/arduino/USBCore.cpp

-12
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,7 @@ const u8 STRING_PRODUCT[] PROGMEM = USB_PRODUCT;
6666
const u8 STRING_MANUFACTURER[] PROGMEM = USB_MANUFACTURER;
6767

6868

69-
#ifdef CDC_ENABLED
7069
#define DEVICE_CLASS 0x02
71-
#else
72-
#define DEVICE_CLASS 0x00
73-
#endif
7470

7571
// DEVICE DESCRIPTOR
7672
const DeviceDescriptor USB_DeviceDescriptor =
@@ -318,11 +314,9 @@ u8 _initEndpoints[] =
318314
{
319315
0,
320316

321-
#ifdef CDC_ENABLED
322317
EP_TYPE_INTERRUPT_IN, // CDC_ENDPOINT_ACM
323318
EP_TYPE_BULK_OUT, // CDC_ENDPOINT_OUT
324319
EP_TYPE_BULK_IN, // CDC_ENDPOINT_IN
325-
#endif
326320

327321
#ifdef PLUGGABLE_USB_ENABLED
328322
//allocate 6 endpoints and remove const so they can be changed by the user
@@ -367,10 +361,8 @@ bool ClassInterfaceRequest(Setup& setup)
367361
{
368362
u8 i = setup.wIndex;
369363

370-
#ifdef CDC_ENABLED
371364
if (CDC_ACM_INTERFACE == i)
372365
return CDC_Setup(setup);
373-
#endif
374366

375367
#ifdef PLUGGABLE_USB_ENABLED
376368
return PUSB_Setup(setup, i);
@@ -448,9 +440,7 @@ int SendInterfaces()
448440
{
449441
u8 interfaces = 0;
450442

451-
#ifdef CDC_ENABLED
452443
CDC_GetInterface(&interfaces);
453-
#endif
454444

455445
#ifdef PLUGGABLE_USB_ENABLED
456446
PUSB_GetInterface(&interfaces);
@@ -629,9 +619,7 @@ ISR(USB_GEN_vect)
629619
// Start of Frame - happens every millisecond so we use it for TX and RX LED one-shot timing, too
630620
if (udint & (1<<SOFI))
631621
{
632-
#ifdef CDC_ENABLED
633622
USB_Flush(CDC_TX); // Send a tx frame if found
634-
#endif
635623

636624
// check whether the one-shot period has elapsed. if so, turn off the LED
637625
if (TxLEDPulse && !(--TxLEDPulse))

Diff for: hardware/arduino/avr/cores/arduino/USBDesc.h

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

19-
#define CDC_ENABLED
2019
#define PLUGGABLE_USB_ENABLED
2120

2221

23-
#ifdef CDC_ENABLED
2422
#define CDC_INTERFACE_COUNT 2
2523
#define CDC_ENPOINT_COUNT 3
26-
#else
27-
#define CDC_INTERFACE_COUNT 0
28-
#define CDC_ENPOINT_COUNT 0
29-
#endif
3024

3125
#define CDC_ACM_INTERFACE 0 // CDC ACM
3226
#define CDC_DATA_INTERFACE 1 // CDC Data
@@ -37,10 +31,8 @@
3731

3832
#define INTERFACE_COUNT (MSC_INTERFACE + MSC_INTERFACE_COUNT)
3933

40-
#ifdef CDC_ENABLED
4134
#define CDC_RX CDC_ENDPOINT_OUT
4235
#define CDC_TX CDC_ENDPOINT_IN
43-
#endif
4436

4537
#define IMANUFACTURER 1
4638
#define IPRODUCT 2

0 commit comments

Comments
 (0)