Fixed Endpoint_Write_Control_Stream_* functions not sending a terminating IN when...
authorDean Camera <dean@fourwalledcubicle.com>
Fri, 20 Nov 2009 06:56:43 +0000 (06:56 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Fri, 20 Nov 2009 06:56:43 +0000 (06:56 +0000)
Demos/Device/ClassDriver/AudioInput/AudioInput.c
Demos/Device/ClassDriver/GenericHID/Descriptors.h
Demos/Device/ClassDriver/GenericHID/GenericHID.c
Demos/Device/LowLevel/AudioInput/AudioInput.c
LUFA/Drivers/USB/LowLevel/Template/Template_Endpoint_Control_R.c
LUFA/Drivers/USB/LowLevel/Template/Template_Endpoint_Control_W.c
LUFA/ManPages/ChangeLog.txt

index cf9d3b4..9bd5fe4 100644 (file)
@@ -102,10 +102,10 @@ void ProcessNextSample(void)
                /* Audio sample is ADC value scaled to fit the entire range */\r
                int16_t AudioSample = ((SAMPLE_MAX_RANGE / ADC_MAX_RANGE) * ADC_GetResult());\r
                \r
                /* Audio sample is ADC value scaled to fit the entire range */\r
                int16_t AudioSample = ((SAMPLE_MAX_RANGE / ADC_MAX_RANGE) * ADC_GetResult());\r
                \r
-#if defined(MICROPHONE_BIASED_TO_HALF_RAIL)\r
+               #if defined(MICROPHONE_BIASED_TO_HALF_RAIL)\r
                /* Microphone is biased to half rail voltage, subtract the bias from the sample value */\r
                AudioSample -= (SAMPLE_MAX_RANGE / 2));\r
                /* Microphone is biased to half rail voltage, subtract the bias from the sample value */\r
                AudioSample -= (SAMPLE_MAX_RANGE / 2));\r
-#endif\r
+               #endif\r
 \r
                Audio_Device_WriteSample16(&Microphone_Audio_Interface, AudioSample);\r
        }\r
 \r
                Audio_Device_WriteSample16(&Microphone_Audio_Interface, AudioSample);\r
        }\r
index 88f16e0..0c77922 100644 (file)
@@ -42,7 +42,7 @@
                #include <LUFA/Drivers/USB/USB.h>\r
                #include <LUFA/Drivers/USB/Class/HID.h>\r
 \r
                #include <LUFA/Drivers/USB/USB.h>\r
                #include <LUFA/Drivers/USB/Class/HID.h>\r
 \r
-       /** Type Defines: */\r
+       /* Type Defines: */\r
                /** Type define for the device configuration descriptor structure. This must be defined in the\r
                 *  application code, as the configuration descriptor contains several sub-descriptors which\r
                 *  vary between devices, and which describe the device's usage to the host.\r
                /** Type define for the device configuration descriptor structure. This must be defined in the\r
                 *  application code, as the configuration descriptor contains several sub-descriptors which\r
                 *  vary between devices, and which describe the device's usage to the host.\r
index bd75e4e..5e26580 100644 (file)
@@ -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 */\r
 struct\r
 {\r
 /** Structure to contain reports from the host, so that they can be echoed back upon request */\r
 struct\r
 {\r
-       uint8_t ReportID;\r
+       uint8_t  ReportID;\r
        uint16_t ReportSize;\r
        uint16_t ReportSize;\r
-       uint8_t ReportData[GENERIC_REPORT_SIZE];\r
+       uint8_t  ReportData[GENERIC_REPORT_SIZE];\r
 } HIDReportEcho;\r
 \r
 /** LUFA HID Class driver interface configuration and state information. This structure is\r
 } HIDReportEcho;\r
 \r
 /** LUFA HID Class driver interface configuration and state information. This structure is\r
index 572e307..a61ff59 100644 (file)
@@ -169,10 +169,10 @@ void USB_Audio_Task(void)
                /* Audio sample is ADC value scaled to fit the entire range */\r
                int16_t AudioSample = ((SAMPLE_MAX_RANGE / ADC_MAX_RANGE) * ADC_GetResult());\r
                \r
                /* Audio sample is ADC value scaled to fit the entire range */\r
                int16_t AudioSample = ((SAMPLE_MAX_RANGE / ADC_MAX_RANGE) * ADC_GetResult());\r
                \r
-#if defined(MICROPHONE_BIASED_TO_HALF_RAIL)\r
+               #if defined(MICROPHONE_BIASED_TO_HALF_RAIL)\r
                /* Microphone is biased to half rail voltage, subtract the bias from the sample value */\r
                AudioSample -= (SAMPLE_MAX_RANGE / 2));\r
                /* Microphone is biased to half rail voltage, subtract the bias from the sample value */\r
                AudioSample -= (SAMPLE_MAX_RANGE / 2));\r
-#endif\r
+               #endif\r
 \r
                /* Write the sample to the buffer */\r
                Endpoint_Write_Word_LE(AudioSample);\r
 \r
                /* Write the sample to the buffer */\r
                Endpoint_Write_Word_LE(AudioSample);\r
index e64f0ed..6948296 100644 (file)
@@ -2,6 +2,9 @@ uint8_t TEMPLATE_FUNC_NAME (void* Buffer, uint16_t Length)
 {\r
        uint8_t* DataStream = ((uint8_t*)Buffer + TEMPLATE_BUFFER_OFFSET(Length));\r
        \r
 {\r
        uint8_t* DataStream = ((uint8_t*)Buffer + TEMPLATE_BUFFER_OFFSET(Length));\r
        \r
+       if (!(Length))\r
+         Endpoint_ClearOUT();\r
+       \r
        while (Length)\r
        {\r
                if (Endpoint_IsSETUPReceived())\r
        while (Length)\r
        {\r
                if (Endpoint_IsSETUPReceived())\r
index a2a9b8c..2de7a74 100644 (file)
@@ -5,7 +5,9 @@ uint8_t TEMPLATE_FUNC_NAME (const void* Buffer, uint16_t Length)
        \r
        if (Length > USB_ControlRequest.wLength)\r
          Length = USB_ControlRequest.wLength;\r
        \r
        if (Length > USB_ControlRequest.wLength)\r
          Length = USB_ControlRequest.wLength;\r
-       \r
+       else if (!(Length))\r
+         Endpoint_ClearIN();\r
+\r
        while (Length || LastPacketFull)\r
        {\r
                if (Endpoint_IsSETUPReceived())\r
        while (Length || LastPacketFull)\r
        {\r
                if (Endpoint_IsSETUPReceived())\r
index 8390fde..57a1a2b 100644 (file)
@@ -51,6 +51,7 @@
   *  - Fixed HID host Class driver report send/receive report broken when issued through the control pipe\r
   *  - Fixed HOST_STATE_AS_GPIOR compile time option being ignored when in host mode (thanks to David Lyons)\r
   *  - Fixed LowLevel Keyboard demo not saving the issues report only after it has been sent to the host\r
   *  - Fixed HID host Class driver report send/receive report broken when issued through the control pipe\r
   *  - Fixed HOST_STATE_AS_GPIOR compile time option being ignored when in host mode (thanks to David Lyons)\r
   *  - Fixed LowLevel Keyboard demo not saving the issues report only after it has been sent to the host\r
+  *  - Fixed Endpoint_Write_Control_Stream_* functions not sending a terminating IN when given data Length is zero\r
   *\r
   *  \section Sec_ChangeLog090924 Version 090924\r
   *\r
   *\r
   *  \section Sec_ChangeLog090924 Version 090924\r
   *\r