stmhal/usbd_desc.c
void USBD_SetVIDPIDRelease(uint16_t vid, uint16_t pid, uint16_t device_release_num, int cdc_only) {
    if (cdc_only) {
        // Make it look like a Communications device if we're only
        // using CDC. Otherwise, windows gets confused when we tell it that
        // its a composite device with only a cdc serial interface.
        hUSBDDeviceDesc[4] = 0x02;
        hUSBDDeviceDesc[5] = 0x00;
        hUSBDDeviceDesc[6] = 0x00;
    } else {
        // For the other modes, we make this look like a composite device.
        hUSBDDeviceDesc[4] = 0xef;
        hUSBDDeviceDesc[5] = 0x02;
        hUSBDDeviceDesc[6] = 0x01;
    }
    hUSBDDeviceDesc[8] = LOBYTE(vid);
    hUSBDDeviceDesc[9] = HIBYTE(vid);
    hUSBDDeviceDesc[10] = LOBYTE(pid);
    hUSBDDeviceDesc[11] = HIBYTE(pid);
    hUSBDDeviceDesc[12] = LOBYTE(device_release_num);
    hUSBDDeviceDesc[13] = HIBYTE(device_release_num);
}
// set the VID, PID and device release number
set the VID, PID and device release number
set the VID PID and device release number
void USBD_SetVIDPIDRelease(uint16_t vid, uint16_t pid, uint16_t device_release_num, int cdc_only) {
    if (cdc_only) {
        hUSBDDeviceDesc[4] = 0x02;
        hUSBDDeviceDesc[5] = 0x00;
        hUSBDDeviceDesc[6] = 0x00;
    } else {
        hUSBDDeviceDesc[4] = 0xef;
        hUSBDDeviceDesc[5] = 0x02;
        hUSBDDeviceDesc[6] = 0x01;
    }
    hUSBDDeviceDesc[8] = LOBYTE(vid);
    hUSBDDeviceDesc[9] = HIBYTE(vid);
    hUSBDDeviceDesc[10] = LOBYTE(pid);
    hUSBDDeviceDesc[11] = HIBYTE(pid);
    hUSBDDeviceDesc[12] = LOBYTE(device_release_num);
    hUSBDDeviceDesc[13] = HIBYTE(device_release_num);
}
void USBD_SetVIDPIDRelease ( uint16_t vid , uint16_t pid , uint16_t device_release_num , int cdc_only ) { if ( cdc_only ) { hUSBDDeviceDesc [ 4 ] = 0x02 ; hUSBDDeviceDesc [ 5 ] = 0x00 ; hUSBDDeviceDesc [ 6 ] = 0x00 ; } else { hUSBDDeviceDesc [ 4 ] = 0xef ; hUSBDDeviceDesc [ 5 ] = 0x02 ; hUSBDDeviceDesc [ 6 ] = 0x01 ; } hUSBDDeviceDesc [ 8 ] = LOBYTE ( vid ) ; hUSBDDeviceDesc [ 9 ] = HIBYTE ( vid ) ; hUSBDDeviceDesc [ 10 ] = LOBYTE ( pid ) ; hUSBDDeviceDesc [ 11 ] = HIBYTE ( pid ) ; hUSBDDeviceDesc [ 12 ] = LOBYTE ( device_release_num ) ; hUSBDDeviceDesc [ 13 ] = HIBYTE ( device_release_num ) ; }
set the VID, PID and device release number
set the VID PID and device release number
// Make it look like a Communications device if we're only // using CDC. Otherwise, windows gets confused when we tell it that // its a composite device with only a cdc serial interface. // For the other modes, we make this look like a composite device.