Commit f79f9abd authored by Dean Camera's avatar Dean Camera
Browse files

Fixed compilation error in the AudioInput demos when...

Fixed compilation error in the AudioInput demos when MICROPHONE_BIASED_TO_HALF_RAIL is defined (thanks to C. Scott Ananian).

Minor documentation cleanups.

Make sure HID class driver uses properly cast pointers when writing to the report buffer.
parent 4e99625f
...@@ -104,7 +104,7 @@ void ProcessNextSample(void) ...@@ -104,7 +104,7 @@ void ProcessNextSample(void)
#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 */ /* Microphone is biased to half rail voltage, subtract the bias from the sample value */
AudioSample -= (SAMPLE_MAX_RANGE / 2)); AudioSample -= (SAMPLE_MAX_RANGE / 2);
#endif #endif
Audio_Device_WriteSample16(&Microphone_Audio_Interface, AudioSample); Audio_Device_WriteSample16(&Microphone_Audio_Interface, AudioSample);
......
...@@ -171,7 +171,7 @@ void USB_Audio_Task(void) ...@@ -171,7 +171,7 @@ void USB_Audio_Task(void)
#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 */ /* Microphone is biased to half rail voltage, subtract the bias from the sample value */
AudioSample -= (SAMPLE_MAX_RANGE / 2)); AudioSample -= (SAMPLE_MAX_RANGE / 2);
#endif #endif
/* Write the sample to the buffer */ /* Write the sample to the buffer */
......
...@@ -181,6 +181,7 @@ uint8_t HID_Host_ReceiveReport(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo, ...@@ -181,6 +181,7 @@ uint8_t HID_Host_ReceiveReport(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo,
Pipe_Unfreeze(); Pipe_Unfreeze();
uint16_t ReportSize; uint16_t ReportSize;
uint8_t* BufferPos = Buffer;
#if !defined(HID_HOST_BOOT_PROTOCOL_ONLY) #if !defined(HID_HOST_BOOT_PROTOCOL_ONLY)
if (!(HIDInterfaceInfo->State.UsingBootProtocol)) if (!(HIDInterfaceInfo->State.UsingBootProtocol))
...@@ -190,7 +191,7 @@ uint8_t HID_Host_ReceiveReport(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo, ...@@ -190,7 +191,7 @@ uint8_t HID_Host_ReceiveReport(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo,
if (HIDInterfaceInfo->Config.HIDParserData->UsingReportIDs) if (HIDInterfaceInfo->Config.HIDParserData->UsingReportIDs)
{ {
ReportID = Pipe_Read_Byte(); ReportID = Pipe_Read_Byte();
*((uint8_t*)Buffer++) = ReportID; *(BufferPos++) = ReportID;
} }
ReportSize = USB_GetHIDReportSize(HIDInterfaceInfo->Config.HIDParserData, ReportID, REPORT_ITEM_TYPE_In); ReportSize = USB_GetHIDReportSize(HIDInterfaceInfo->Config.HIDParserData, ReportID, REPORT_ITEM_TYPE_In);
...@@ -201,7 +202,7 @@ uint8_t HID_Host_ReceiveReport(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo, ...@@ -201,7 +202,7 @@ uint8_t HID_Host_ReceiveReport(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo,
ReportSize = Pipe_BytesInPipe(); ReportSize = Pipe_BytesInPipe();
} }
if ((ErrorCode = Pipe_Read_Stream_LE(Buffer, ReportSize, NO_STREAM_CALLBACK)) != PIPE_RWSTREAM_NoError) if ((ErrorCode = Pipe_Read_Stream_LE(BufferPos, ReportSize, NO_STREAM_CALLBACK)) != PIPE_RWSTREAM_NoError)
return ErrorCode; return ErrorCode;
Pipe_ClearIN(); Pipe_ClearIN();
......
...@@ -86,7 +86,7 @@ ...@@ -86,7 +86,7 @@
#define USE_INTERNAL_SERIAL NO_DESCRIPTOR #define USE_INTERNAL_SERIAL NO_DESCRIPTOR
#endif #endif
/** Macro to calculate the power value for the device descriptor, from a given number of milliamps. */ /** Macro to calculate the power value for the configuration descriptor, from a given number of milliamps. */
#define USB_CONFIG_POWER_MA(mA) ((mA) >> 1) #define USB_CONFIG_POWER_MA(mA) ((mA) >> 1)
/** Macro to calculate the Unicode length of a string with a given number of Unicode characters. /** Macro to calculate the Unicode length of a string with a given number of Unicode characters.
...@@ -124,7 +124,6 @@ ...@@ -124,7 +124,6 @@
*/ */
#define USB_CONFIG_ATTR_BUSPOWERED 0x80 #define USB_CONFIG_ATTR_BUSPOWERED 0x80
/** Can be masked with other configuration descriptor attributes for a \ref USB_Descriptor_Configuration_Header_t /** Can be masked with other configuration descriptor attributes for a \ref USB_Descriptor_Configuration_Header_t
* descriptor's ConfigAttributes value to indicate that the specified configuration can draw its power * descriptor's ConfigAttributes value to indicate that the specified configuration can draw its power
* from the device's own power source. * from the device's own power source.
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
* - Fixed ADC routines failing to read the extended channels (Channels 8 to 13, Internal Temperature Sensor) on the * - Fixed ADC routines failing to read the extended channels (Channels 8 to 13, Internal Temperature Sensor) on the
* U4 series USB AVR parts * U4 series USB AVR parts
* - Fixed LowLevel MassStorage demo broken on the U2 AVRs due to double-banked endpoints * - Fixed LowLevel MassStorage demo broken on the U2 AVRs due to double-banked endpoints
* - Fixed compilation error in the AudioInput demos when MICROPHONE_BIASED_TO_HALF_RAIL is defined (thanks to C. Scott Ananian)
* *
* \section Sec_ChangeLog100219 Version 100219 * \section Sec_ChangeLog100219 Version 100219
* *
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment