X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/071e02c6b6b4837fa9cf0b6d4c749994e02638d7..cd39c38d5f39d89da989859afd72576b4c1532aa:/Demos/Device/Incomplete/Sideshow/Sideshow.c?ds=sidebyside diff --git a/Demos/Device/Incomplete/Sideshow/Sideshow.c b/Demos/Device/Incomplete/Sideshow/Sideshow.c index 3e9778e29..e99a26b36 100644 --- a/Demos/Device/Incomplete/Sideshow/Sideshow.c +++ b/Demos/Device/Incomplete/Sideshow/Sideshow.c @@ -115,25 +115,22 @@ void EVENT_USB_Device_ConfigurationChanged(void) void EVENT_USB_Device_UnhandledControlRequest(void) { - /* Process UFI specific control requests */ switch (USB_ControlRequest.bRequest) { case REQ_GetOSFeatureDescriptor: if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_VENDOR | REQREC_DEVICE)) { void* DescriptorPointer; - uint16_t DescriptorSize; + uint16_t DescriptorSize = USB_GetOSFeatureDescriptor(USB_ControlRequest.wValue, USB_ControlRequest.wIndex, + &DescriptorPointer, &DescriptorSize); - if (!(USB_GetOSFeatureDescriptor(USB_ControlRequest.wValue, USB_ControlRequest.wIndex, - &DescriptorPointer, &DescriptorSize))) - { - return; - } + if (DescriptorSize == NO_DESCRIPTOR) + return; Endpoint_ClearSETUP(); Endpoint_Write_Control_PStream_LE(DescriptorPointer, DescriptorSize); - Endpoint_ClearOUT(); + Endpoint_ClearOUT(); } break;