X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/9cec85bfd92a77a97e7d12625897de2682dfacd7..fabfdd454a11440a5789a70f6476889b02928438:/Demos/Device/DualCDC/DualCDC.c diff --git a/Demos/Device/DualCDC/DualCDC.c b/Demos/Device/DualCDC/DualCDC.c index 5d2dd5f90..9750ea23e 100644 --- a/Demos/Device/DualCDC/DualCDC.c +++ b/Demos/Device/DualCDC/DualCDC.c @@ -186,16 +186,8 @@ EVENT_HANDLER(USB_ConfigurationChanged) */ EVENT_HANDLER(USB_UnhandledControlPacket) { - uint8_t* LineCodingData; - - /* Discard the unused wValue parameter */ - Endpoint_Discard_Word(); - - /* wIndex indicates the interface being controlled */ - uint16_t wIndex = Endpoint_Read_Word_LE(); - /* Determine which interface's Line Coding data is being set from the wIndex parameter */ - LineCodingData = (wIndex == 0) ? (uint8_t*)&LineCoding1 : (uint8_t*)&LineCoding2; + uint8_t* LineCodingData = (USB_ControlRequest.wIndex == 0) ? (uint8_t*)&LineCoding1 : (uint8_t*)&LineCoding2; /* Process CDC specific control requests */ switch (USB_ControlRequest.bRequest) @@ -207,7 +199,7 @@ EVENT_HANDLER(USB_UnhandledControlPacket) Endpoint_ClearSETUP(); /* Write the line coding data to the control endpoint */ - Endpoint_Write_Control_Stream_LE(LineCodingData, sizeof(CDC_Line_Coding_t), Endpoint_MemSpaceCallback_RAM); + Endpoint_Write_Control_Stream_LE(LineCodingData, sizeof(CDC_Line_Coding_t)); /* Finalize the stream transfer to send the last packet or clear the host abort */ Endpoint_ClearOUT(); @@ -304,7 +296,7 @@ TASK(CDC1_Task) Endpoint_SelectEndpoint(CDC1_TX_EPNUM); /* Write the String to the Endpoint */ - Endpoint_Write_Stream_LE(ReportString, strlen(ReportString), Endpoint_MemSpaceCallback_RAM); + Endpoint_Write_Stream_LE(ReportString, strlen(ReportString)); /* Finalize the stream transfer to send the last packet */ Endpoint_ClearIN(); @@ -351,7 +343,7 @@ TASK(CDC2_Task) Endpoint_SelectEndpoint(CDC2_TX_EPNUM); /* Write the received data to the endpoint */ - Endpoint_Write_Stream_LE(&Buffer, DataLength, Endpoint_MemSpaceCallback_RAM); + Endpoint_Write_Stream_LE(&Buffer, DataLength); /* Finalize the stream transfer to send the last packet */ Endpoint_ClearIN();