diff --git a/Demos/Device/ClassDriver/AudioInput/AudioInput.c b/Demos/Device/ClassDriver/AudioInput/AudioInput.c index cf9d3b47e57623e1cb2d9937cb270ec1c8646347..9bd5fe40227f69f63dde51c7e1fec3e239f64bc5 100644 --- a/Demos/Device/ClassDriver/AudioInput/AudioInput.c +++ b/Demos/Device/ClassDriver/AudioInput/AudioInput.c @@ -102,10 +102,10 @@ void ProcessNextSample(void) /* Audio sample is ADC value scaled to fit the entire range */ int16_t AudioSample = ((SAMPLE_MAX_RANGE / ADC_MAX_RANGE) * ADC_GetResult()); -#if defined(MICROPHONE_BIASED_TO_HALF_RAIL) + #if defined(MICROPHONE_BIASED_TO_HALF_RAIL) /* Microphone is biased to half rail voltage, subtract the bias from the sample value */ AudioSample -= (SAMPLE_MAX_RANGE / 2)); -#endif + #endif Audio_Device_WriteSample16(&Microphone_Audio_Interface, AudioSample); } diff --git a/Demos/Device/ClassDriver/GenericHID/Descriptors.h b/Demos/Device/ClassDriver/GenericHID/Descriptors.h index 88f16e03e47f578924e58eda03b4f61c9a3e8692..0c7792200183f543bb57ed62dd23443ead9389ed 100644 --- a/Demos/Device/ClassDriver/GenericHID/Descriptors.h +++ b/Demos/Device/ClassDriver/GenericHID/Descriptors.h @@ -42,7 +42,7 @@ #include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/Class/HID.h> - /** Type Defines: */ + /* Type Defines: */ /** Type define for the device configuration descriptor structure. This must be defined in the * application code, as the configuration descriptor contains several sub-descriptors which * vary between devices, and which describe the device's usage to the host. diff --git a/Demos/Device/ClassDriver/GenericHID/GenericHID.c b/Demos/Device/ClassDriver/GenericHID/GenericHID.c index bd75e4ec1cfa2d47436e5083ae43161445914b4f..5e265805f65b85c6b1655504352f7be702d1bcdc 100644 --- a/Demos/Device/ClassDriver/GenericHID/GenericHID.c +++ b/Demos/Device/ClassDriver/GenericHID/GenericHID.c @@ -42,9 +42,9 @@ uint8_t PrevHIDReportBuffer[GENERIC_REPORT_SIZE]; /** Structure to contain reports from the host, so that they can be echoed back upon request */ struct { - uint8_t ReportID; + uint8_t ReportID; uint16_t ReportSize; - uint8_t ReportData[GENERIC_REPORT_SIZE]; + uint8_t ReportData[GENERIC_REPORT_SIZE]; } HIDReportEcho; /** LUFA HID Class driver interface configuration and state information. This structure is diff --git a/Demos/Device/LowLevel/AudioInput/AudioInput.c b/Demos/Device/LowLevel/AudioInput/AudioInput.c index 572e307b02f806a6830255c9cf54fe52a690cd73..a61ff593ce0af1f69ae1528a6b925c08b81b90bc 100644 --- a/Demos/Device/LowLevel/AudioInput/AudioInput.c +++ b/Demos/Device/LowLevel/AudioInput/AudioInput.c @@ -169,10 +169,10 @@ void USB_Audio_Task(void) /* Audio sample is ADC value scaled to fit the entire range */ int16_t AudioSample = ((SAMPLE_MAX_RANGE / ADC_MAX_RANGE) * ADC_GetResult()); -#if defined(MICROPHONE_BIASED_TO_HALF_RAIL) + #if defined(MICROPHONE_BIASED_TO_HALF_RAIL) /* Microphone is biased to half rail voltage, subtract the bias from the sample value */ AudioSample -= (SAMPLE_MAX_RANGE / 2)); -#endif + #endif /* Write the sample to the buffer */ Endpoint_Write_Word_LE(AudioSample); diff --git a/LUFA/Drivers/USB/LowLevel/Template/Template_Endpoint_Control_R.c b/LUFA/Drivers/USB/LowLevel/Template/Template_Endpoint_Control_R.c index e64f0ed4a5952aceebaf42420a139addbdcbbf74..6948296a5509aadbd6188b1a1b18e8ac50b59b26 100644 --- a/LUFA/Drivers/USB/LowLevel/Template/Template_Endpoint_Control_R.c +++ b/LUFA/Drivers/USB/LowLevel/Template/Template_Endpoint_Control_R.c @@ -2,6 +2,9 @@ uint8_t TEMPLATE_FUNC_NAME (void* Buffer, uint16_t Length) { uint8_t* DataStream = ((uint8_t*)Buffer + TEMPLATE_BUFFER_OFFSET(Length)); + if (!(Length)) + Endpoint_ClearOUT(); + while (Length) { if (Endpoint_IsSETUPReceived()) diff --git a/LUFA/Drivers/USB/LowLevel/Template/Template_Endpoint_Control_W.c b/LUFA/Drivers/USB/LowLevel/Template/Template_Endpoint_Control_W.c index a2a9b8c1a0cf742188094a884d7f653170776e26..2de7a74f56e106483817ba7446b1f309c33e8178 100644 --- a/LUFA/Drivers/USB/LowLevel/Template/Template_Endpoint_Control_W.c +++ b/LUFA/Drivers/USB/LowLevel/Template/Template_Endpoint_Control_W.c @@ -5,7 +5,9 @@ uint8_t TEMPLATE_FUNC_NAME (const void* Buffer, uint16_t Length) if (Length > USB_ControlRequest.wLength) Length = USB_ControlRequest.wLength; - + else if (!(Length)) + Endpoint_ClearIN(); + while (Length || LastPacketFull) { if (Endpoint_IsSETUPReceived()) diff --git a/LUFA/ManPages/ChangeLog.txt b/LUFA/ManPages/ChangeLog.txt index 8390fde2ca54f6589d9a887d05273b23742a08c7..57a1a2b29fbf1b968009ec8b7c92eb92ae3f7854 100644 --- a/LUFA/ManPages/ChangeLog.txt +++ b/LUFA/ManPages/ChangeLog.txt @@ -51,6 +51,7 @@ * - Fixed HID host Class driver report send/receive report broken when issued through the control pipe * - Fixed HOST_STATE_AS_GPIOR compile time option being ignored when in host mode (thanks to David Lyons) * - Fixed LowLevel Keyboard demo not saving the issues report only after it has been sent to the host + * - Fixed Endpoint_Write_Control_Stream_* functions not sending a terminating IN when given data Length is zero * * \section Sec_ChangeLog090924 Version 090924 *