Skip to content
Snippets Groups Projects
Commit ff8bc899 authored by Martino Facchin's avatar Martino Facchin Committed by Cristian Maglie
Browse files

use different EP for CDC IN and OUT

parent ffd05f25
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment