Moved calls to Device mode Class Driver events to after the request has been acknowledged, so that long event handlers do do skew the timing of the control requests.

Fixed USBtoSerial and Benito project SetLineEncoding calls failing if the USART is busy, due to the RX ISR delaying the control request handler.
pull/1469/head
Dean Camera 14 years ago
parent 81998ce297
commit 1be3436e89

@ -64,9 +64,11 @@ void CDC_Device_ProcessControlRequest(USB_ClassInfo_CDC_Device_t* const CDCInter
if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE)) if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
{ {
Endpoint_ClearSETUP(); Endpoint_ClearSETUP();
Endpoint_Read_Control_Stream_LE(&CDCInterfaceInfo->State.LineEncoding, sizeof(CDCInterfaceInfo->State.LineEncoding)); Endpoint_Read_Control_Stream_LE(&CDCInterfaceInfo->State.LineEncoding, sizeof(CDCInterfaceInfo->State.LineEncoding));
EVENT_CDC_Device_LineEncodingChanged(CDCInterfaceInfo);
Endpoint_ClearIN(); Endpoint_ClearIN();
EVENT_CDC_Device_LineEncodingChanged(CDCInterfaceInfo);
} }
break; break;
@ -76,9 +78,10 @@ void CDC_Device_ProcessControlRequest(USB_ClassInfo_CDC_Device_t* const CDCInter
Endpoint_ClearSETUP(); Endpoint_ClearSETUP();
CDCInterfaceInfo->State.ControlLineStates.HostToDevice = USB_ControlRequest.wValue; CDCInterfaceInfo->State.ControlLineStates.HostToDevice = USB_ControlRequest.wValue;
EVENT_CDC_Device_ControLineStateChanged(CDCInterfaceInfo);
Endpoint_ClearStatusStage(); Endpoint_ClearStatusStage();
EVENT_CDC_Device_ControLineStateChanged(CDCInterfaceInfo);
} }
break; break;
@ -86,10 +89,9 @@ void CDC_Device_ProcessControlRequest(USB_ClassInfo_CDC_Device_t* const CDCInter
if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE)) if (USB_ControlRequest.bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))
{ {
Endpoint_ClearSETUP(); Endpoint_ClearSETUP();
Endpoint_ClearStatusStage();
EVENT_CDC_Device_BreakSent(CDCInterfaceInfo, (uint8_t)USB_ControlRequest.wValue); EVENT_CDC_Device_BreakSent(CDCInterfaceInfo, (uint8_t)USB_ControlRequest.wValue);
Endpoint_ClearStatusStage();
} }
break; break;

@ -83,8 +83,9 @@ void RNDIS_Device_ProcessControlRequest(USB_ClassInfo_RNDIS_Device_t* const RNDI
Endpoint_ClearSETUP(); Endpoint_ClearSETUP();
Endpoint_Read_Control_Stream_LE(RNDISInterfaceInfo->State.RNDISMessageBuffer, USB_ControlRequest.wLength); Endpoint_Read_Control_Stream_LE(RNDISInterfaceInfo->State.RNDISMessageBuffer, USB_ControlRequest.wLength);
RNDIS_Device_ProcessRNDISControlMessage(RNDISInterfaceInfo);
Endpoint_ClearIN(); Endpoint_ClearIN();
RNDIS_Device_ProcessRNDISControlMessage(RNDISInterfaceInfo);
} }
break; break;

@ -20,6 +20,8 @@
* SCSI_Codes.h file as these values are part of the MassStorage Class Driver * SCSI_Codes.h file as these values are part of the MassStorage Class Driver
* - Added compile time error to the AVRISP-MKII project when built for the U4 chips, as the default VTARGET detection ADC channel * - Added compile time error to the AVRISP-MKII project when built for the U4 chips, as the default VTARGET detection ADC channel
* does not exist on these chips (thanks to Marco) * does not exist on these chips (thanks to Marco)
* - Moved calls to Device mode Class Driver events to after the request has been acknowledged, so that long event handlers do
* do skew the timing of the control requests
* *
* <b>Fixed:</b> * <b>Fixed:</b>
* - Fixed USB_GetHIDReportItemInfo() function modifying the given report item's data when the report item does not exist * - Fixed USB_GetHIDReportItemInfo() function modifying the given report item's data when the report item does not exist
@ -28,6 +30,8 @@
* missed SCSI sense values when the host retrieves the sense key (thanks to Martin Degelsegger) * missed SCSI sense values when the host retrieves the sense key (thanks to Martin Degelsegger)
* - Fixed critical pipe/endpoint memory allocation issue where the bank memory address space could be silently overlapped * - Fixed critical pipe/endpoint memory allocation issue where the bank memory address space could be silently overlapped
* in the USB controller if the endpoints or pipes were allocated in anything other than ascending order (thanks to Martin Degelsegger) * in the USB controller if the endpoints or pipes were allocated in anything other than ascending order (thanks to Martin Degelsegger)
* - Fixed USBtoSerial and Benito project SetLineEncoding calls failing if the USART is busy, due to the RX ISR delaying the control
* request handler
* *
* \section Sec_ChangeLog100807 Version 100807 * \section Sec_ChangeLog100807 Version 100807
* <b>New:</b> * <b>New:</b>

@ -121,6 +121,7 @@ LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1
LUFA_OPTS += -D USE_FLASH_DESCRIPTORS LUFA_OPTS += -D USE_FLASH_DESCRIPTORS
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
LUFA_OPTS += -D INTERRUPT_CONTROL_ENDPOINT
LUFA_OPTS += -D AVR_RESET_LINE_PORT="PORTD" LUFA_OPTS += -D AVR_RESET_LINE_PORT="PORTD"
LUFA_OPTS += -D AVR_RESET_LINE_DDR="DDRD" LUFA_OPTS += -D AVR_RESET_LINE_DDR="DDRD"

@ -121,6 +121,7 @@ LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1 LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1
LUFA_OPTS += -D USE_FLASH_DESCRIPTORS LUFA_OPTS += -D USE_FLASH_DESCRIPTORS
LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
LUFA_OPTS += -D INTERRUPT_CONTROL_ENDPOINT
# Create the LUFA source path variables by including the LUFA root makefile # Create the LUFA source path variables by including the LUFA root makefile

Loading…
Cancel
Save