X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/071e02c6b6b4837fa9cf0b6d4c749994e02638d7..4cc7f5200beef90c39c8c8310ed7c8b849afb4d9:/Demos/Device/Incomplete/Sideshow/Descriptors.c diff --git a/Demos/Device/Incomplete/Sideshow/Descriptors.c b/Demos/Device/Incomplete/Sideshow/Descriptors.c index f6d16c841..a3f28b58d 100644 --- a/Demos/Device/Incomplete/Sideshow/Descriptors.c +++ b/Demos/Device/Incomplete/Sideshow/Descriptors.c @@ -154,7 +154,9 @@ USB_OSCompatibleIDDescriptor_t PROGMEM DevCompatIDs = SubCompatibleID: "UNIV1"} }; -uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, void** const DescriptorAddress) +uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, + const uint8_t wIndex, + void** const DescriptorAddress) { const uint8_t DescriptorType = (wValue >> 8); const uint8_t DescriptorNumber = (wValue & 0xFF); @@ -192,7 +194,7 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, Size = pgm_read_byte(&SerialNumberString.Header.Size); break; case 0xEE: - /* A Microsoft-proprietary extention. String address 0xEE is used by Windows for + /* A Microsoft-proprietary extension. String address 0xEE is used by Windows for "OS Descriptors", which in this case allows us to indicate that our device is Sideshow compatible regardless of VID/PID values. */ Address = (void*)&OSDescriptorString; @@ -207,11 +209,12 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, return Size; } -bool USB_GetOSFeatureDescriptor(const uint16_t wValue, const uint8_t wIndex, - void** const DescriptorAddress, uint16_t* const DescriptorSize) +uint16_t USB_GetOSFeatureDescriptor(const uint16_t wValue, + const uint8_t wIndex, + void** const DescriptorAddress) { void* Address = NULL; - uint16_t Size = 0; + uint16_t Size = NO_DESCRIPTOR; /* Check if a device level OS feature descriptor is being requested */ if (wValue == 0x0000) @@ -224,13 +227,6 @@ bool USB_GetOSFeatureDescriptor(const uint16_t wValue, const uint8_t wIndex, } } - if (Address != NULL) - { - *DescriptorAddress = Address; - *DescriptorSize = Size; - - return true; - } - - return false; -} \ No newline at end of file + *DescriptorAddress = Address; + return Size; +}