aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Drivers/USB
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2010-03-24 05:50:09 +0000
committerDean Camera <dean@fourwalledcubicle.com>2010-03-24 05:50:09 +0000
commitf79f9abd28040d839b02ea22cdfde3d0a34f3482 (patch)
treecf9a30b0536dd642aa5768b7dac52ab04e56b003 /LUFA/Drivers/USB
parent4e99625f7cd9ccd10251c871670b286536483333 (diff)
downloadlufa-f79f9abd28040d839b02ea22cdfde3d0a34f3482.tar.gz
lufa-f79f9abd28040d839b02ea22cdfde3d0a34f3482.tar.bz2
lufa-f79f9abd28040d839b02ea22cdfde3d0a34f3482.zip
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.
Diffstat (limited to 'LUFA/Drivers/USB')
-rw-r--r--LUFA/Drivers/USB/Class/Host/HID.c5
-rw-r--r--LUFA/Drivers/USB/HighLevel/StdDescriptors.h3
2 files changed, 4 insertions, 4 deletions
diff --git a/LUFA/Drivers/USB/Class/Host/HID.c b/LUFA/Drivers/USB/Class/Host/HID.c
index b95f73c73..5d5d2ef98 100644
--- a/LUFA/Drivers/USB/Class/Host/HID.c
+++ b/LUFA/Drivers/USB/Class/Host/HID.c
@@ -181,6 +181,7 @@ uint8_t HID_Host_ReceiveReport(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo,
Pipe_Unfreeze();
uint16_t ReportSize;
+ uint8_t* BufferPos = Buffer;
#if !defined(HID_HOST_BOOT_PROTOCOL_ONLY)
if (!(HIDInterfaceInfo->State.UsingBootProtocol))
@@ -190,7 +191,7 @@ uint8_t HID_Host_ReceiveReport(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo,
if (HIDInterfaceInfo->Config.HIDParserData->UsingReportIDs)
{
ReportID = Pipe_Read_Byte();
- *((uint8_t*)Buffer++) = ReportID;
+ *(BufferPos++) = ReportID;
}
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,
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;
Pipe_ClearIN();
diff --git a/LUFA/Drivers/USB/HighLevel/StdDescriptors.h b/LUFA/Drivers/USB/HighLevel/StdDescriptors.h
index b79b7847c..4090aaa3d 100644
--- a/LUFA/Drivers/USB/HighLevel/StdDescriptors.h
+++ b/LUFA/Drivers/USB/HighLevel/StdDescriptors.h
@@ -86,7 +86,7 @@
#define USE_INTERNAL_SERIAL NO_DESCRIPTOR
#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)
/** Macro to calculate the Unicode length of a string with a given number of Unicode characters.
@@ -124,7 +124,6 @@
*/
#define USB_CONFIG_ATTR_BUSPOWERED 0x80
-
/** 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
* from the device's own power source.