From ff8bc8996a43f8c628d84671b36262e5cf054654 Mon Sep 17 00:00:00 2001
From: Martino Facchin <m.facchin@arduino.cc>
Date: Fri, 3 Jul 2015 15:54:26 +0200
Subject: [PATCH] use different EP for CDC IN and OUT

---
 cores/arduino/USB/CDC.cpp   | 2 --
 cores/arduino/USB/USBDesc.h | 4 ++--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/cores/arduino/USB/CDC.cpp b/cores/arduino/USB/CDC.cpp
index f3e4cd70..94407333 100644
--- a/cores/arduino/USB/CDC.cpp
+++ b/cores/arduino/USB/CDC.cpp
@@ -176,11 +176,9 @@ int Serial_::available(void)
 {
 	ring_buffer *buffer = &cdc_rx_buffer;
 	if (buffer->full) {
-		USB->DEVICE.DeviceEndpoint[2].EPINTENSET.reg = ~USB_DEVICE_EPINTENCLR_RXSTP;
 		return CDC_SERIAL_BUFFER_SIZE;
 	}
 	if (buffer->head == buffer->tail) {
-		USB->DEVICE.DeviceEndpoint[2].EPINTENSET.reg = USB_DEVICE_EPINTENCLR_RXSTP;
 		USB->DEVICE.DeviceEndpoint[2].EPINTENSET.reg = USB_DEVICE_EPINTENCLR_TRCPT(1);
 	}
 	return (uint32_t)(CDC_SERIAL_BUFFER_SIZE + buffer->head - buffer->tail) % CDC_SERIAL_BUFFER_SIZE;
diff --git a/cores/arduino/USB/USBDesc.h b/cores/arduino/USB/USBDesc.h
index 4c326389..655fb6d0 100644
--- a/cores/arduino/USB/USBDesc.h
+++ b/cores/arduino/USB/USBDesc.h
@@ -28,11 +28,11 @@
 #define CDC_DATA_INTERFACE	1	// CDC Data
 #define CDC_ENDPOINT_ACM	1
 #define CDC_ENDPOINT_OUT	2
-#define CDC_ENDPOINT_IN		2
+#define CDC_ENDPOINT_IN		3
 
 // HID
 #define HID_INTERFACE		2   // HID
-#define HID_ENDPOINT_INT	3
+#define HID_ENDPOINT_INT	4
 
 // Defined string description
 #define IMANUFACTURER	1
-- 
GitLab