Skip to content

Commit 9487fbe

Browse files
facchinmmattairtech
authored andcommitted
use different EP for CDC IN and OUT
1 parent 85825a3 commit 9487fbe

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

cores/arduino/USB/CDC.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,11 +176,9 @@ int Serial_::available(void)
176176
{
177177
ring_buffer *buffer = &cdc_rx_buffer;
178178
if (buffer->full) {
179-
USB->DEVICE.DeviceEndpoint[2].EPINTENSET.reg = ~USB_DEVICE_EPINTENCLR_RXSTP;
180179
return CDC_SERIAL_BUFFER_SIZE;
181180
}
182181
if (buffer->head == buffer->tail) {
183-
USB->DEVICE.DeviceEndpoint[2].EPINTENSET.reg = USB_DEVICE_EPINTENCLR_RXSTP;
184182
USB->DEVICE.DeviceEndpoint[2].EPINTENSET.reg = USB_DEVICE_EPINTENCLR_TRCPT(1);
185183
}
186184
return (uint32_t)(CDC_SERIAL_BUFFER_SIZE + buffer->head - buffer->tail) % CDC_SERIAL_BUFFER_SIZE;

cores/arduino/USB/USBDesc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@
3939
#define CDC_DATA_INTERFACE 1 // CDC Data
4040
#define CDC_ENDPOINT_ACM 1
4141
#define CDC_ENDPOINT_OUT 2
42-
#define CDC_ENDPOINT_IN 2
42+
#define CDC_ENDPOINT_IN 3
4343

4444
// HID
4545
#define HID_INTERFACE 2 // HID
46-
#define HID_ENDPOINT_INT 3
46+
#define HID_ENDPOINT_INT 4
4747

4848
// Defined string description
4949
#define IMANUFACTURER 1

0 commit comments

Comments
 (0)