@@ -440,8 +440,8 @@ static bool usb_get_descriptor(u16_t type_index, u16_t lang_id,
440440 * Invalid types of descriptors,
441441 * see USB Spec. Revision 2.0, 9.4.3 Get Descriptor
442442 */
443- if ((type == DESC_INTERFACE ) || (type == DESC_ENDPOINT ) ||
444- (type > DESC_OTHER_SPEED )) {
443+ if ((type == USB_INTERFACE_DESC ) || (type == USB_ENDPOINT_DESC ) ||
444+ (type > USB_OTHER_SPEED )) {
445445 return false;
446446 }
447447
@@ -464,7 +464,7 @@ static bool usb_get_descriptor(u16_t type_index, u16_t lang_id,
464464 /* set data pointer */
465465 * data = p ;
466466 /* get length from structure */
467- if (type == DESC_CONFIGURATION ) {
467+ if (type == USB_CONFIGURATION_DESC ) {
468468 /* configuration descriptor is an
469469 * exception, length is at offset
470470 * 2 and 3
@@ -539,7 +539,7 @@ static bool usb_set_configuration(u8_t config_index, u8_t alt_setting)
539539 /* configure endpoints for this configuration/altsetting */
540540 while (p [DESC_bLength ] != 0U ) {
541541 switch (p [DESC_bDescriptorType ]) {
542- case DESC_CONFIGURATION :
542+ case USB_CONFIGURATION_DESC :
543543 /* remember current configuration index */
544544 cur_config = p [CONF_DESC_bConfigurationValue ];
545545 if (cur_config == config_index ) {
@@ -548,13 +548,13 @@ static bool usb_set_configuration(u8_t config_index, u8_t alt_setting)
548548
549549 break ;
550550
551- case DESC_INTERFACE :
551+ case USB_INTERFACE_DESC :
552552 /* remember current alternate setting */
553553 cur_alt_setting =
554554 p [INTF_DESC_bAlternateSetting ];
555555 break ;
556556
557- case DESC_ENDPOINT :
557+ case USB_ENDPOINT_DESC :
558558 if ((cur_config != config_index ) ||
559559 (cur_alt_setting != alt_setting )) {
560560 break ;
@@ -598,7 +598,7 @@ static bool usb_set_interface(u8_t iface, u8_t alt_setting)
598598
599599 while (p [DESC_bLength ] != 0U ) {
600600 switch (p [DESC_bDescriptorType ]) {
601- case DESC_INTERFACE :
601+ case USB_INTERFACE_DESC :
602602 /* remember current alternate setting */
603603 cur_alt_setting = p [INTF_DESC_bAlternateSetting ];
604604 cur_iface = p [INTF_DESC_bInterfaceNumber ];
@@ -610,10 +610,9 @@ static bool usb_set_interface(u8_t iface, u8_t alt_setting)
610610
611611 LOG_DBG ("iface_num %u alt_set %u" , iface , alt_setting );
612612 break ;
613- case DESC_ENDPOINT :
613+ case USB_ENDPOINT_DESC :
614614 if ((cur_iface != iface ) ||
615615 (cur_alt_setting != alt_setting )) {
616- break ;
617616 }
618617
619618 found = set_endpoint ((struct usb_ep_descriptor * )p );
0 commit comments