/* 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
-#endif\r
+ #endif\r
\r
Audio_Device_WriteSample16(&Microphone_Audio_Interface, AudioSample);\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
/** 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
- 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
/* 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
-#endif\r
+ #endif\r
\r
/* Write the sample to the buffer */\r
Endpoint_Write_Word_LE(AudioSample);\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
\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
* - 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