X-Git-Url: http://git.linex4red.de/pub/lufa.git/blobdiff_plain/2b54cd984dbd9a56ae79f3f9733f088edcc12150..8df0cf3241ff7de055850b630e8d878d1023bb5d:/LUFA/Drivers/USB/Class/Device/CDC.c?ds=sidebyside diff --git a/LUFA/Drivers/USB/Class/Device/CDC.c b/LUFA/Drivers/USB/Class/Device/CDC.c index dc8c1e7a6..29e5c25eb 100644 --- a/LUFA/Drivers/USB/Class/Device/CDC.c +++ b/LUFA/Drivers/USB/Class/Device/CDC.c @@ -51,10 +51,14 @@ void CDC_Device_ProcessControlRequest(USB_ClassInfo_CDC_Device_t* const CDCInter if (USB_ControlRequest.bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE)) { Endpoint_ClearSETUP(); + + while (!(Endpoint_IsINReady())); + Endpoint_Write_32_LE(CDCInterfaceInfo->State.LineEncoding.BaudRateBPS); Endpoint_Write_8(CDCInterfaceInfo->State.LineEncoding.CharFormat); Endpoint_Write_8(CDCInterfaceInfo->State.LineEncoding.ParityType); Endpoint_Write_8(CDCInterfaceInfo->State.LineEncoding.DataBits); + Endpoint_ClearIN(); Endpoint_ClearStatusStage(); } @@ -64,13 +68,17 @@ void CDC_Device_ProcessControlRequest(USB_ClassInfo_CDC_Device_t* const CDCInter if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE)) { Endpoint_ClearSETUP(); + + while (!(Endpoint_IsOUTReceived())); + CDCInterfaceInfo->State.LineEncoding.BaudRateBPS = Endpoint_Read_32_LE(); CDCInterfaceInfo->State.LineEncoding.CharFormat = Endpoint_Read_8(); CDCInterfaceInfo->State.LineEncoding.ParityType = Endpoint_Read_8(); CDCInterfaceInfo->State.LineEncoding.DataBits = Endpoint_Read_8(); + Endpoint_ClearOUT(); Endpoint_ClearStatusStage(); - + EVENT_CDC_Device_LineEncodingChanged(CDCInterfaceInfo); }