X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/f51017f8fb5a02029bce577e3d7226cb5158d830..5ca1d7bf8f1aa774c076b614fa692c2026d7e854:/Demos/Device/Incomplete/Sideshow/Sideshow.c diff --git a/Demos/Device/Incomplete/Sideshow/Sideshow.c b/Demos/Device/Incomplete/Sideshow/Sideshow.c index 8454f9de8..d67fae03f 100644 --- a/Demos/Device/Incomplete/Sideshow/Sideshow.c +++ b/Demos/Device/Incomplete/Sideshow/Sideshow.c @@ -131,7 +131,7 @@ void EVENT_USB_UnhandledControlPacket(void) Endpoint_ClearSETUP(); - Endpoint_Write_Control_Stream_LE(DescriptorPointer, DescriptorSize); + Endpoint_Write_Control_PStream_LE(DescriptorPointer, DescriptorSize); Endpoint_ClearOUT(); } @@ -141,17 +141,17 @@ void EVENT_USB_UnhandledControlPacket(void) void SideShow_Task(void) { - /* Check if the USB System is connected to a Host */ - if (USB_IsConnected) + /* Device must be connected and configured for the task to run */ + if (USB_DeviceState != DEVICE_STATE_Configured) + return; + + /* Select the SideShow data out endpoint */ + Endpoint_SelectEndpoint(SIDESHOW_OUT_EPNUM); + + /* Check to see if a new SideShow message has been received */ + if (Endpoint_IsReadWriteAllowed()) { - /* Select the SideShow data out endpoint */ - Endpoint_SelectEndpoint(SIDESHOW_OUT_EPNUM); - - /* Check to see if a new SideShow message has been received */ - if (Endpoint_IsReadWriteAllowed()) - { - /* Process the received SideShow message */ - Sideshow_ProcessCommandPacket(); - } + /* Process the received SideShow message */ + Sideshow_ProcessCommandPacket(); } }