这一段没看懂:
/* get usb other-speed descriptor */ case USB_DESCR_TYP_SPEED: if( USBHS_DevSpeed == USBHS_SPEED_HIGH ) { /* High speed mode为啥高速模式拷贝的是fs的配置? */ memcpy( &TAB_USB_HS_OSC_DESC[ 2 ], &MyCfgDescr_FS[ 2 ], DEF_USBD_CONFIG_FS_DESC_LEN - 2 ); pUSBHS_Descr = ( uint8_t * )&TAB_USB_HS_OSC_DESC[ 0 ]; len = DEF_USBD_CONFIG_FS_DESC_LEN; } else if( USBHS_DevSpeed == USBHS_SPEED_FULL ) { /* Full speed mode 这里正好反过来? */ memcpy( &TAB_USB_FS_OSC_DESC[ 2 ], &MyCfgDescr_HS[ 2 ], DEF_USBD_CONFIG_HS_DESC_LEN - 2 ); pUSBHS_Descr = ( uint8_t * )&TAB_USB_FS_OSC_DESC[ 0 ]; len = DEF_USBD_CONFIG_HS_DESC_LEN; } else { errflag = 0xFF; } break;
/* USB Full-Speed Mode, Other speed configuration Descriptor */ uint8_t TAB_USB_FS_OSC_DESC[ sizeof(MyCfgDescr_HS) ] = { /* Other parts are copied through the program */ 0x09, 0x07, }; /* USB High-Speed Mode, Other speed configuration Descriptor */ uint8_t TAB_USB_HS_OSC_DESC[ sizeof(MyCfgDescr_FS) ] = { /* Other parts are copied through the program */ 0x09, 0x07, };
热门产品 :
CH641: PD及无线充电专用MCU