USB: compile-time endpoints allocation
[bertos.git] / bertos / drv / usbser.c
index b6c7161fda4af59b7bbdc766b7e5101873c8939a..78444b136b66446e59087283b03844b838887421 100644 (file)
@@ -52,6 +52,7 @@
 #include <cpu/power.h> /* cpu_relax() */
 
 #include <drv/usb.h>
+#include <drv/usb_endpoint.h>
 
 #include <string.h> /* memcpy() */
 
@@ -112,7 +113,7 @@ static const UsbEndpointDesc usb_serial_ep_report_descriptor =
 {
        .bLength = sizeof(usb_serial_ep_report_descriptor),
        .bDescriptorType = USB_DT_ENDPOINT,
-       .bEndpointAddress = USB_DIR_IN | 1,
+       .bEndpointAddress = USB_DIR_IN | USB_SERIAL_EP_REPORT,
        .bmAttributes = USB_ENDPOINT_XFER_INT,
        .wMaxPacketSize = usb_cpu_to_le16((uint16_t)8),
        .bInterval = 1,
@@ -122,7 +123,7 @@ static const UsbEndpointDesc usb_serial_ep_in_descriptor =
 {
        .bLength = sizeof(usb_serial_ep_in_descriptor),
        .bDescriptorType = USB_DT_ENDPOINT,
-       .bEndpointAddress = USB_DIR_IN | 3,
+       .bEndpointAddress = USB_DIR_IN | USB_SERIAL_EP_IN,
        .bmAttributes = USB_ENDPOINT_XFER_BULK,
        .wMaxPacketSize = usb_cpu_to_le16((uint16_t)64),
        .bInterval = 0,
@@ -132,7 +133,7 @@ static const UsbEndpointDesc usb_serial_ep_out_descriptor =
 {
        .bLength = sizeof(usb_serial_ep_in_descriptor),
        .bDescriptorType = USB_DT_ENDPOINT,
-       .bEndpointAddress = USB_DIR_OUT | 2,
+       .bEndpointAddress = USB_DIR_OUT | USB_SERIAL_EP_OUT,
        .bmAttributes = USB_ENDPOINT_XFER_BULK,
        .wMaxPacketSize = usb_cpu_to_le16((uint16_t)64),
        .bInterval = 0,