From 211712d66d6949941141964341bb937bf1422636 Mon Sep 17 00:00:00 2001
From: Dean Camera <dean@fourwalledcubicle.com>
Date: Mon, 20 Jul 2009 03:14:41 +0000
Subject: [PATCH] Remove ClearPipeStall routine from the StillImageHost demo,
 as there is now a version of the function built into the library itself.

---
 .../Host/Incomplete/PrinterHost/PrinterHost.c |  2 +-
 .../StillImageHost/Lib/StillImageCommands.c   | 27 ++-----------------
 .../StillImageHost/Lib/StillImageCommands.h   |  1 -
 3 files changed, 3 insertions(+), 27 deletions(-)

diff --git a/Demos/Host/Incomplete/PrinterHost/PrinterHost.c b/Demos/Host/Incomplete/PrinterHost/PrinterHost.c
index 9eb05abd8..d9f409e97 100644
--- a/Demos/Host/Incomplete/PrinterHost/PrinterHost.c
+++ b/Demos/Host/Incomplete/PrinterHost/PrinterHost.c
@@ -226,7 +226,7 @@ void USB_Printer_Host(void)
 				break;
 			}
 
-			puts_P(PSTR("Test Page Sent, Waiting for Pipe...\r\n"));
+			puts_P(PSTR("Test Page Sent.\r\n"));
 		
 			/* Indicate device no longer busy */
 			LEDs_SetAllLEDs(LEDMASK_USB_READY);
diff --git a/Demos/Host/LowLevel/StillImageHost/Lib/StillImageCommands.c b/Demos/Host/LowLevel/StillImageHost/Lib/StillImageCommands.c
index c0a9575f4..e0d71a059 100644
--- a/Demos/Host/LowLevel/StillImageHost/Lib/StillImageCommands.c
+++ b/Demos/Host/LowLevel/StillImageHost/Lib/StillImageCommands.c
@@ -133,7 +133,7 @@ uint8_t SImage_RecieveBlockHeader(void)
 		if (Pipe_IsStalled())
 		{
 			/* Clear the stall condition on the OUT pipe */
-			SImage_ClearPipeStall(SIMAGE_DATA_OUT_PIPE);
+			USB_Host_ClearPipeStall(SIMAGE_DATA_OUT_PIPE);
 
 			/* Return error code and break out of the loop */
 			return PIPE_RWSTREAM_PipeStalled;
@@ -145,7 +145,7 @@ uint8_t SImage_RecieveBlockHeader(void)
 		if (Pipe_IsStalled())
 		{
 			/* Clear the stall condition on the IN pipe */
-			SImage_ClearPipeStall(SIMAGE_DATA_IN_PIPE);
+			USB_Host_ClearPipeStall(SIMAGE_DATA_IN_PIPE);
 
 			/* Return error code */
 			return PIPE_RWSTREAM_PipeStalled;
@@ -262,26 +262,3 @@ bool SImage_IsEventReceived(void)
 	
 	return IsEventReceived;
 }
-
-/** Clears the stall condition in the attached device on the nominated endpoint number.
- *
- *  \param[in] EndpointNum  Endpoint number in the attached device whose stall condition is to be cleared
- *
- *  \return A value from the USB_Host_SendControlErrorCodes_t enum
- */
-uint8_t SImage_ClearPipeStall(const uint8_t EndpointNum)
-{
-	USB_ControlRequest = (USB_Request_Header_t)
-		{
-			.bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_ENDPOINT),
-			.bRequest      = REQ_ClearFeature,
-			.wValue        = FEATURE_ENDPOINT_HALT,
-			.wIndex        = EndpointNum,
-			.wLength       = 0,
-		};
-	
-	/* Select the control pipe for the request transfer */
-	Pipe_SelectPipe(PIPE_CONTROLPIPE);
-
-	return USB_Host_SendControlRequest(NULL);
-}
diff --git a/Demos/Host/LowLevel/StillImageHost/Lib/StillImageCommands.h b/Demos/Host/LowLevel/StillImageHost/Lib/StillImageCommands.h
index 600051051..b44b7524f 100644
--- a/Demos/Host/LowLevel/StillImageHost/Lib/StillImageCommands.h
+++ b/Demos/Host/LowLevel/StillImageHost/Lib/StillImageCommands.h
@@ -111,6 +111,5 @@
 		uint8_t SImage_SendData(void* Buffer, uint16_t Bytes);
 		uint8_t SImage_ReadData(void* Buffer, uint16_t Bytes);
 		bool    SImage_IsEventReceived(void);
-		uint8_t SImage_ClearPipeStall(const uint8_t EndpointNum);
 
 #endif
-- 
GitLab