From 5c274d106b8b30403ce8742056518ce33f397ed2 Mon Sep 17 00:00:00 2001
From: Dean Camera <dean@fourwalledcubicle.com>
Date: Mon, 25 Jul 2011 01:11:24 +0000
Subject: [PATCH] Fixed USB_USBTask not being called internally in stream
 transfers between packets when Partial Stream Transfers are used.

Remove old unused function prototype in the LowLevel MassStorage device demo.
---
 Demos/Device/LowLevel/MassStorage/MassStorage.h           | 2 --
 .../Drivers/USB/Core/AVR8/Template/Template_Endpoint_RW.c | 8 ++++----
 LUFA/Drivers/USB/Core/UC3/Template/Template_Endpoint_RW.c | 8 ++++----
 .../USB/Core/XMEGA/Template/Template_Endpoint_RW.c        | 8 ++++----
 LUFA/ManPages/ChangeLog.txt                               | 1 +
 5 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/Demos/Device/LowLevel/MassStorage/MassStorage.h b/Demos/Device/LowLevel/MassStorage/MassStorage.h
index c08e630c2..08f3388a2 100644
--- a/Demos/Device/LowLevel/MassStorage/MassStorage.h
+++ b/Demos/Device/LowLevel/MassStorage/MassStorage.h
@@ -90,7 +90,5 @@
 			static void ReturnCommandStatus(void);
 		#endif
 
-		uint8_t StreamCallback_AbortOnMassStoreReset(void);
-
 #endif
 
diff --git a/LUFA/Drivers/USB/Core/AVR8/Template/Template_Endpoint_RW.c b/LUFA/Drivers/USB/Core/AVR8/Template/Template_Endpoint_RW.c
index 9ce034007..46b006364 100644
--- a/LUFA/Drivers/USB/Core/AVR8/Template/Template_Endpoint_RW.c
+++ b/LUFA/Drivers/USB/Core/AVR8/Template/Template_Endpoint_RW.c
@@ -53,16 +53,16 @@ uint8_t TEMPLATE_FUNC_NAME (TEMPLATE_BUFFER_TYPE const Buffer,
 		{
 			TEMPLATE_CLEAR_ENDPOINT();
 
+			#if !defined(INTERRUPT_CONTROL_ENDPOINT)
+			USB_USBTask();
+			#endif
+
 			if (BytesProcessed != NULL)
 			{
 				*BytesProcessed += BytesInTransfer;
 				return ENDPOINT_RWSTREAM_IncompleteTransfer;
 			}
 
-			#if !defined(INTERRUPT_CONTROL_ENDPOINT)
-			USB_USBTask();
-			#endif
-
 			if ((ErrorCode = Endpoint_WaitUntilReady()))
 			  return ErrorCode;
 		}
diff --git a/LUFA/Drivers/USB/Core/UC3/Template/Template_Endpoint_RW.c b/LUFA/Drivers/USB/Core/UC3/Template/Template_Endpoint_RW.c
index 9ce034007..46b006364 100644
--- a/LUFA/Drivers/USB/Core/UC3/Template/Template_Endpoint_RW.c
+++ b/LUFA/Drivers/USB/Core/UC3/Template/Template_Endpoint_RW.c
@@ -53,16 +53,16 @@ uint8_t TEMPLATE_FUNC_NAME (TEMPLATE_BUFFER_TYPE const Buffer,
 		{
 			TEMPLATE_CLEAR_ENDPOINT();
 
+			#if !defined(INTERRUPT_CONTROL_ENDPOINT)
+			USB_USBTask();
+			#endif
+
 			if (BytesProcessed != NULL)
 			{
 				*BytesProcessed += BytesInTransfer;
 				return ENDPOINT_RWSTREAM_IncompleteTransfer;
 			}
 
-			#if !defined(INTERRUPT_CONTROL_ENDPOINT)
-			USB_USBTask();
-			#endif
-
 			if ((ErrorCode = Endpoint_WaitUntilReady()))
 			  return ErrorCode;
 		}
diff --git a/LUFA/Drivers/USB/Core/XMEGA/Template/Template_Endpoint_RW.c b/LUFA/Drivers/USB/Core/XMEGA/Template/Template_Endpoint_RW.c
index 9ce034007..46b006364 100644
--- a/LUFA/Drivers/USB/Core/XMEGA/Template/Template_Endpoint_RW.c
+++ b/LUFA/Drivers/USB/Core/XMEGA/Template/Template_Endpoint_RW.c
@@ -53,16 +53,16 @@ uint8_t TEMPLATE_FUNC_NAME (TEMPLATE_BUFFER_TYPE const Buffer,
 		{
 			TEMPLATE_CLEAR_ENDPOINT();
 
+			#if !defined(INTERRUPT_CONTROL_ENDPOINT)
+			USB_USBTask();
+			#endif
+
 			if (BytesProcessed != NULL)
 			{
 				*BytesProcessed += BytesInTransfer;
 				return ENDPOINT_RWSTREAM_IncompleteTransfer;
 			}
 
-			#if !defined(INTERRUPT_CONTROL_ENDPOINT)
-			USB_USBTask();
-			#endif
-
 			if ((ErrorCode = Endpoint_WaitUntilReady()))
 			  return ErrorCode;
 		}
diff --git a/LUFA/ManPages/ChangeLog.txt b/LUFA/ManPages/ChangeLog.txt
index e41d288ef..91aa6feb2 100644
--- a/LUFA/ManPages/ChangeLog.txt
+++ b/LUFA/ManPages/ChangeLog.txt
@@ -68,6 +68,7 @@
   *     option was not enabled on the AVR8s
   *   - Fixed lack of C++ compatibility in some internal header files causing compile errors when using LUFA in C++ projects
   *   - Fixed error in the pipe unordered allocation algorithm for the AVR8 devices breaking compatibility with some devices
+  *   - Fixed USB_USBTask not being called internally in stream transfers between packets when Partial Stream Transfers are used
   *  - Library Applications:
   *   - Fixed incorrect signature in the CDC and DFU class bootloaders for the ATMEGA8U2
   *   - Fixed KeyboardHost and KeyboardHostWithParser demos displaying incorrect values when numerical keys were pressed
-- 
GitLab