diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2009-08-07 06:55:31 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2009-08-07 06:55:31 +0000 |
commit | d423090b26ade8912e669d6c6d3c5463e0669429 (patch) | |
tree | f443783209b96313146c539de92c408788d2778d /LUFA | |
parent | 85c2716f2d37bb50d126102fcdd09fb78d26ebc5 (diff) | |
download | lufa-d423090b26ade8912e669d6c6d3c5463e0669429.tar.gz lufa-d423090b26ade8912e669d6c6d3c5463e0669429.tar.bz2 lufa-d423090b26ade8912e669d6c6d3c5463e0669429.zip |
Cleanups to RNDIS device demos. Fix issue in RNDIS demos where the memory would become corrupted due to an incorrect bounds check when iterating over the port state table, causing random resets.
Revert change to Template_Endpoint_Control_R.c, which broke control stream reads.
Remove uneeded ADC.h include in the class driver AudioOutput demo.
Diffstat (limited to 'LUFA')
-rw-r--r-- | LUFA/Drivers/USB/LowLevel/Template/Template_Endpoint_Control_R.c | 13 |
1 files changed, 2 insertions, 11 deletions
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 f6afb6901..a2a0c3bd5 100644 --- a/LUFA/Drivers/USB/LowLevel/Template/Template_Endpoint_Control_R.c +++ b/LUFA/Drivers/USB/LowLevel/Template/Template_Endpoint_Control_R.c @@ -1,12 +1,8 @@ uint8_t TEMPLATE_FUNC_NAME (void* Buffer, uint16_t Length)
{
- uint8_t* DataStream = (uint8_t*)(Buffer + TEMPLATE_BUFFER_OFFSET(Length));
- bool LastPacketFull = false;
+ uint8_t* DataStream = (uint8_t*)(Buffer + TEMPLATE_BUFFER_OFFSET(Length));
- if (Length > USB_ControlRequest.wLength)
- Length = USB_ControlRequest.wLength;
-
- while (Length || LastPacketFull)
+ while (Length)
{
if (Endpoint_IsSETUPReceived())
return ENDPOINT_RWCSTREAM_HostAborted;
@@ -16,8 +12,6 @@ uint8_t TEMPLATE_FUNC_NAME (void* Buffer, uint16_t Length) if (Endpoint_IsOUTReceived())
{
- LastPacketFull = (Endpoint_BytesInEndpoint() == USB_ControlEndpointSize);
-
while (Length && Endpoint_BytesInEndpoint())
{
TEMPLATE_TRANSFER_BYTE(DataStream);
@@ -25,9 +19,6 @@ uint8_t TEMPLATE_FUNC_NAME (void* Buffer, uint16_t Length) }
Endpoint_ClearOUT();
-
- if (!(LastPacketFull))
- Length = 0;
}
}
|