diff options
Diffstat (limited to 'LUFA/Drivers')
-rw-r--r-- | LUFA/Drivers/USB/LowLevel/Template/Template_Endpoint_Control_R.c | 3 | ||||
-rw-r--r-- | LUFA/Drivers/USB/LowLevel/Template/Template_Endpoint_Control_W.c | 4 |
2 files changed, 6 insertions, 1 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 e64f0ed4a..6948296a5 100644 --- a/LUFA/Drivers/USB/LowLevel/Template/Template_Endpoint_Control_R.c +++ b/LUFA/Drivers/USB/LowLevel/Template/Template_Endpoint_Control_R.c @@ -2,6 +2,9 @@ uint8_t TEMPLATE_FUNC_NAME (void* Buffer, uint16_t Length) {
uint8_t* DataStream = ((uint8_t*)Buffer + TEMPLATE_BUFFER_OFFSET(Length));
+ if (!(Length))
+ Endpoint_ClearOUT();
+
while (Length)
{
if (Endpoint_IsSETUPReceived())
diff --git a/LUFA/Drivers/USB/LowLevel/Template/Template_Endpoint_Control_W.c b/LUFA/Drivers/USB/LowLevel/Template/Template_Endpoint_Control_W.c index a2a9b8c1a..2de7a74f5 100644 --- a/LUFA/Drivers/USB/LowLevel/Template/Template_Endpoint_Control_W.c +++ b/LUFA/Drivers/USB/LowLevel/Template/Template_Endpoint_Control_W.c @@ -5,7 +5,9 @@ uint8_t TEMPLATE_FUNC_NAME (const void* Buffer, uint16_t Length) if (Length > USB_ControlRequest.wLength)
Length = USB_ControlRequest.wLength;
-
+ else if (!(Length))
+ Endpoint_ClearIN();
+
while (Length || LastPacketFull)
{
if (Endpoint_IsSETUPReceived())
|