Skip to content

Commit ff8bc89

Browse files
facchinmcmaglie
authored andcommitted
use different EP for CDC IN and OUT
1 parent ffd05f2 commit ff8bc89

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
@@ -28,11 +28,11 @@
2828
#define CDC_DATA_INTERFACE 1 // CDC Data
2929
#define CDC_ENDPOINT_ACM 1
3030
#define CDC_ENDPOINT_OUT 2
31-
#define CDC_ENDPOINT_IN 2
31+
#define CDC_ENDPOINT_IN 3
3232

3333
// HID
3434
#define HID_INTERFACE 2 // HID
35-
#define HID_ENDPOINT_INT 3
35+
#define HID_ENDPOINT_INT 4
3636

3737
// Defined string description
3838
#define IMANUFACTURER 1

0 commit comments

Comments
 (0)